Class Register

java.lang.Object
dev.xdpxi.xdlib.api.v3.Register

public class Register extends Object
Utility class for registering blocks, items, and armor materials in Minecraft.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static net.minecraft.block.Block
     
    static net.minecraft.item.Item
     
    static net.minecraft.registry.entry.RegistryEntry<net.minecraft.item.ArmorMaterial>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Initializes and tests the registration of a block, an item, and an armor material.
    static net.minecraft.block.Block
    registerBlock(net.minecraft.block.Block block, String name, String MOD_ID)
    Registers a block and its corresponding block item in the game.
    static net.minecraft.item.Item
    registerItem(net.minecraft.item.Item item, String id, String MOD_ID)
    Registers an item in the game.
    static net.minecraft.registry.entry.RegistryEntry<net.minecraft.item.ArmorMaterial>
    registerMaterial(String id, Map<net.minecraft.item.ArmorItem.Type, Integer> defensePoints, int enchantability, net.minecraft.registry.entry.RegistryEntry<net.minecraft.sound.SoundEvent> equipSound, Supplier<net.minecraft.recipe.Ingredient> repairIngredientSupplier, float toughness, float knockbackResistance, boolean dyeable, String MOD_ID)
    Registers an armor material in the game.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • test_block

      public static net.minecraft.block.Block test_block
    • test_item

      public static net.minecraft.item.Item test_item
    • test_material

      public static net.minecraft.registry.entry.RegistryEntry<net.minecraft.item.ArmorMaterial> test_material
  • Constructor Details

    • Register

      public Register()
  • Method Details

    • init

      public static void init()
      Initializes and tests the registration of a block, an item, and an armor material. This method is used for testing purposes and logs the results of each registration attempt.
    • registerBlock

      public static net.minecraft.block.Block registerBlock(net.minecraft.block.Block block, String name, String MOD_ID)
      Registers a block and its corresponding block item in the game.
      Parameters:
      block - The block to register.
      name - The name of the block.
      MOD_ID - The mod ID.
      Returns:
      The registered block.
    • registerItem

      public static net.minecraft.item.Item registerItem(net.minecraft.item.Item item, String id, String MOD_ID)
      Registers an item in the game.
      Parameters:
      item - The item to register.
      id - The ID of the item.
      MOD_ID - The mod ID.
      Returns:
      The registered item.
    • registerMaterial

      public static net.minecraft.registry.entry.RegistryEntry<net.minecraft.item.ArmorMaterial> registerMaterial(String id, Map<net.minecraft.item.ArmorItem.Type, Integer> defensePoints, int enchantability, net.minecraft.registry.entry.RegistryEntry<net.minecraft.sound.SoundEvent> equipSound, Supplier<net.minecraft.recipe.Ingredient> repairIngredientSupplier, float toughness, float knockbackResistance, boolean dyeable, String MOD_ID)
      Registers an armor material in the game.
      Parameters:
      id - The ID of the armor material.
      defensePoints - A map of armor types to their defense points.
      enchantability - The enchantability of the armor material.
      equipSound - The sound played when equipping the armor.
      repairIngredientSupplier - A supplier for the repair ingredient.
      toughness - The toughness of the armor material.
      knockbackResistance - The knockback resistance of the armor material.
      dyeable - Whether the armor material is dyeable.
      MOD_ID - The mod ID.
      Returns:
      A RegistryEntry containing the registered ArmorMaterial.