Loading...
Beta Modpages Unclaimed

Kotlin Extensions [Fabric]

Kotlin Extensions for various Minecraft classes

0 Likes
249 Downloads
Created by MarioAndWeegee3

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


AD Become Premium to remove Ads!

What means Verified?

  • Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
  • Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
  • Security: The mod should not contain any malicious code or attempts to steal personal information.
  • Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
  • Originality: The mod should be original and not a copy of someone else's work.
  • Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
  • Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
  • License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
  • Documentation: The mod should come with clear and detailed documentation on how to install and use it.

AD Become Premium to remove Ads!

How to Install

1

Download Forge & Java

Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.

2

Prepare

Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.

3

Add Mods

Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder

4

Enjoy

You are now Ready. Re-start your Game and start Playing.

More Mods like this

Mantle

Shared code for Forge mods

AutoRegLib

A library to ease menial tasks in mod development.

CraftTweaker

CraftTweaker allows modpacks and servers to customize the game. With CraftTweaker you can change recipes, script events, add new commands and even change item properties!

CoFH Core

Contains Core Functionality for all Team CoFH mods. Also does some really cool stuff on its own!

Patchouli

Accessible, Data-Driven, Dependency-Free Documentation for Minecraft Modders and Pack Makers

Baubles

An addon module and API for Thaumcraft