Kotlin Extensions [Fabric]

Quick rating

Community listing page, reviews here may not be monitored by the author.

Kotlin Extensions [Fabric]

No reviews yet

Kotlin Extensions for various Minecraft classes

Mod Loaders
Fabric
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
Kotlin Extensions 0.0.0+1.15.2

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

This mod is an API that provides useful extensions to existing vanilla classes. They are grouped based on the class that is primarily dealt with or returned by the function.

Block Extensions

  • Block.makeItem() - creates a new BlockItem based on the block. Optionally takes an Item.Settings.
  • Block.matches(Identifier) - checks whether the block is contained in the tag with the given id
  • Block.matches(String) - converts the String to an Identifier then calls matches(Identifier)

Identifier Extensions

  • String.id - converts the String to an Identifier
  • Pair.id - converts the Pair to an Identifier
  • Identifier.component1() and .component2() - allows for destructuring of Identifiers
  • String.validId() - checks if the String is a valid Identifier
  • Pair.validId() checks if the Pair is a valid Identifier

Item Extensions

  • Item.stack() - creates a new ItemStack with the Item. Optionally takes an Int for the count.
  • Item.matches(Tag or Identifier or String) - checks if the Item is in the Tag. Same idea as Block::matches

NBT Tag Extensions

  • compooundTag(vararg Pair) - creates a new CompoundTag with the given elements
  • CompoundTag.set(String, Tag) - operator for CompoundTag::put
  • Map.toCompoundTag() - creates a new CompoundTag from the map's elements
  • Any?.toTag() - Creates a new Tag from the object. Note: if the object cannot be converted into a tag, this will crash the game.
  • interface NBTSerializable - Allows you to create the NBT representation for your classes. Not needed for Entity and BlockEntity subclasses.

Registry Extensions

  • Registry.get(String) - converts to an Identifier and gets the value in the Registry
  • Registry.set(Identifier or String, T) - Registers the value in the Registry using Registry.register
  • Identifier.item() and .block() and .entityType() and .blockEntityType() and .registry() - gets the value at the Identifier in the appropriate Registry

Tag Extensions

  • Identifier.tag() - gets a Tag at the Identifier. Only valid for Item, Block, EntityType, and Fluid. Any other type will crash the game.
  • String.tag() - converts to an Identifier and gets the Tag at it
  • Tag.isEqual(Tag) - Tag.equals is not properly overridden. Use this to compare equality with tags.

World Extensions

  • World.runOnClient(()-Unit) - Runs the passed function only on the client
  • World.runOnServer(()-Unit) - Runs the passed function only on the server

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works