Advertisement
Game_Spriter

RegistryHandler.java

Nov 9th, 2020
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.01 KB | None | 0 0
  1. package com.gamespriter.runictechnology.util;
  2.  
  3. import com.gamespriter.runictechnology.RunicTechnology;
  4. import com.gamespriter.runictechnology.armor.ModArmorMaterials;
  5. import com.gamespriter.runictechnology.blocks.BlockItemBase;
  6. import com.gamespriter.runictechnology.blocks.Crystallizer;
  7. import com.gamespriter.runictechnology.blocks.TammethystBlock;
  8. import com.gamespriter.runictechnology.blocks.TammethystOre;
  9. import com.gamespriter.runictechnology.items.ItemBase;
  10. import com.gamespriter.runictechnology.tools.RunicTechItemTier;
  11. import net.minecraft.block.Block;
  12. import net.minecraft.inventory.EquipmentSlotType;
  13. import net.minecraft.item.*;
  14. import net.minecraftforge.fml.RegistryObject;
  15. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  16. import net.minecraftforge.registries.DeferredRegister;
  17. import net.minecraftforge.registries.ForgeRegistries;
  18.  
  19. public class RegistryHandler {
  20.    
  21.     public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, RunicTechnology.MOD_ID);
  22.     public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, RunicTechnology.MOD_ID);
  23.    
  24.     public static void init() {
  25.         ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
  26.         BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
  27.     }
  28.    
  29.     //region Items
  30.     public static final RegistryObject<Item> TAMMETHYST = ITEMS.register("tammethyst", ItemBase::new);
  31.     public static final RegistryObject<Item> TAMMETHYST_DUST = ITEMS.register("tammethyst_dust", ItemBase::new);
  32.     //endregion
  33.    
  34.     //region Tools
  35.     //region Tammethyst Tools
  36.     public static final RegistryObject<SwordItem> TAMMETHYST_SWORD = ITEMS.register("tammethyst_sword", () ->
  37.             new SwordItem(RunicTechItemTier.TAMMETHYST, 3, -2.4f, new Item.Properties().group(RunicTechnology.TAB))
  38.     );
  39.     public static final RegistryObject<PickaxeItem> TAMMETHYST_PICKAXE = ITEMS.register("tammethyst_pickaxe", () ->
  40.             new PickaxeItem(RunicTechItemTier.TAMMETHYST, 1, -2.8f, new Item.Properties().group(RunicTechnology.TAB))
  41.     );
  42.     public static final RegistryObject<AxeItem> TAMMETHYST_AXE = ITEMS.register("tammethyst_axe", () ->
  43.             new AxeItem(RunicTechItemTier.TAMMETHYST, 6, -3.1f, new Item.Properties().group(RunicTechnology.TAB))
  44.             //TODO: Increase durability on Axe
  45.     );
  46.     public static final RegistryObject<ShovelItem> TAMMETHYST_SHOVEL = ITEMS.register("tammethyst_shovel", () ->
  47.             new ShovelItem(RunicTechItemTier.TAMMETHYST, 1.0f, -3.0f, new Item.Properties().group(RunicTechnology.TAB))
  48.     );
  49.     public static final RegistryObject<HoeItem> TAMMETHYST_HOE = ITEMS.register("tammethyst_hoe", () ->
  50.             new HoeItem(RunicTechItemTier.TAMMETHYST, -3, -0.0f, new Item.Properties().group(RunicTechnology.TAB))
  51.     );
  52.     //endregion
  53.    
  54.     //region Tier 2 Tools
  55.     //TODO: Make tier 2 tools
  56.     //endregion
  57.    
  58.     //region Tier 3 Tools
  59.     //TODO: Make tier 3 tools
  60.     //endregion
  61.     //endregion
  62.    
  63.     //region Armor
  64.     //region Tammethyst Armor
  65.     public static final RegistryObject<ArmorItem> TAMMETHYST_HELMET = ITEMS.register("tammethyst_helmet", () ->
  66.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.HEAD, new Item.Properties().group(RunicTechnology.TAB))
  67.     );
  68.     public static final RegistryObject<ArmorItem> TAMMETHYST_CHESTPLATE = ITEMS.register("tammethyst_chestplate", () ->
  69.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.CHEST, new Item.Properties().group(RunicTechnology.TAB))
  70.     );
  71.     public static final RegistryObject<ArmorItem> TAMMETHYST_LEGS = ITEMS.register("tammethyst_leggings", () ->
  72.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.LEGS, new Item.Properties().group(RunicTechnology.TAB))
  73.     );
  74.     public static final RegistryObject<ArmorItem> TAMMETHYST_BOOTS = ITEMS.register("tammethyst_boots", () ->
  75.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.FEET, new Item.Properties().group(RunicTechnology.TAB))
  76.     );
  77.     //endregion
  78.     //endregion
  79.    
  80.     //region Blocks
  81.     public static final RegistryObject<Block> TAMMETHYST_BLOCK = BLOCKS.register("tammethyst_block", TammethystBlock::new);
  82.     public static final RegistryObject<Block> TAMMETHYST_ORE = BLOCKS.register("tammethyst_ore", TammethystOre::new);
  83.     public static final RegistryObject<Block> CRYSTALLIZER = BLOCKS.register("crystallizer", Crystallizer::new);
  84.     //endregion
  85.    
  86.     //region Block Items
  87.     public static final RegistryObject<Item> TAMMETHYST_BLOCK_ITEM = ITEMS.register("tammethyst_block", () -> new BlockItemBase(TAMMETHYST_BLOCK.get()));
  88.     public static final RegistryObject<Item> TAMMETHYST_ORE_ITEM = ITEMS.register("tammethyst_ore", () -> new BlockItemBase(TAMMETHYST_ORE.get()));
  89.     public static final RegistryObject<Item> CRYSTALLIZER_ITEM = ITEMS.register("crystallizer", () -> new BlockItemBase(CRYSTALLIZER.get()));
  90.     //endregion
  91. }
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement