Class WSMLMBUtil

java.lang.Object
net.anawesomguy.wsmlmb.util.WSMLMBUtil

public final class WSMLMBUtil extends Object
This class contains some utility methods used in the library.
  • Method Details

    • toTranslatable

      public static net.minecraft.text.MutableText toTranslatable(String langKey)
      Creates a translatable text out of the given language key.

      This is used for support between different versions.

      Parameters:
      langKey - the language key to create a translatable text out of.
      Returns:
      a translatable text representing the given langKey.
    • addToGroup

      public static void addToGroup(Object itemGroup, net.minecraft.item.ItemConvertible... items)
      Adds items to an item group (creative tab).

      This is used for support between different versions.

      Parameters:
      itemGroup - the group of the item you want to add the item to. Must be of the correct type for your Minecraft version, or a string for the name of the ItemGroups field you want to add it to.
      items - the items to add to the group.
    • addToGroup

      public static void addToGroup(Object itemGroup, net.minecraft.item.ItemStack... items)
      Adds items to an item group (creative tab).

      This is used for support between different versions.

      Parameters:
      itemGroup - the group of the item you want to add the item to. Must be of the correct type for your Minecraft version, a string for the name of the ItemGroups field you want to add it to, or an Identifier.
      items - the items to add to the group.
    • getModifyEntriesEvent

      public static net.fabricmc.fabric.api.event.Event<net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents.ModifyEntries> getModifyEntriesEvent(Object itemGroup)
    • getItemGroup

      public static Object getItemGroup(String name)