Advertisement
Game_Spriter

RegistryHandler.java

Oct 29th, 2020
2,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.57 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.TammethystBlock;
  7. import com.gamespriter.runictechnology.blocks.TammethystOre;
  8. import com.gamespriter.runictechnology.items.ItemBase;
  9. import com.gamespriter.runictechnology.tools.RunicTechItemTier;
  10. import net.minecraft.block.Block;
  11. import net.minecraft.block.OreBlock;
  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.     //endregion
  32.    
  33.     //region Tools
  34.     //region Tammethyst Tools
  35.     public static final RegistryObject<SwordItem> TAMMETHYST_SWORD = ITEMS.register("tammethyst_sword", () ->
  36.             new SwordItem(RunicTechItemTier.TAMMETHYST, 3, -2.4f, new Item.Properties().group(RunicTechnology.TAB))
  37.     );
  38.     public static final RegistryObject<PickaxeItem> TAMMETHYST_PICKAXE = ITEMS.register("tammethyst_pickaxe", () ->
  39.             new PickaxeItem(RunicTechItemTier.TAMMETHYST, 1, -2.8f, new Item.Properties().group(RunicTechnology.TAB))
  40.     );
  41.     public static final RegistryObject<AxeItem> TAMMETHYST_AXE = ITEMS.register("tammethyst_axe", () ->
  42.             new AxeItem(RunicTechItemTier.TAMMETHYST, 6, -3.1f, new Item.Properties().group(RunicTechnology.TAB))
  43.     );
  44.     public static final RegistryObject<ShovelItem> TAMMETHYST_SHOVEL = ITEMS.register("tammethyst_shovel", () ->
  45.             new ShovelItem(RunicTechItemTier.TAMMETHYST, 1.0f, -3.0f, new Item.Properties().group(RunicTechnology.TAB))
  46.     );
  47.     public static final RegistryObject<HoeItem> TAMMETHYST_HOE = ITEMS.register("tammethyst_hoe", () ->
  48.             new HoeItem(RunicTechItemTier.TAMMETHYST, -3, -0.0f, new Item.Properties().group(RunicTechnology.TAB))
  49.     );
  50.     //endregion
  51.    
  52.     //region Tier 2 Tools
  53.     //TODO: Make tier 2 tools
  54.     //endregion
  55.    
  56.     //region Tier 3 Tools
  57.     //TODO: Make tier 3 tools
  58.     //endregion
  59.     //endregion
  60.    
  61.     //region Armor
  62.     //region Tammethyst Armor
  63.     public static final RegistryObject<ArmorItem> TAMMETHYST_HELMET = ITEMS.register("tammethyst_helmet", () ->
  64.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.HEAD, new Item.Properties().group(RunicTechnology.TAB))
  65.     );
  66.     public static final RegistryObject<ArmorItem> TAMMETHYST_CHESTPLATE = ITEMS.register("tammethyst_chestplate", () ->
  67.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.CHEST, new Item.Properties().group(RunicTechnology.TAB))
  68.     );
  69.     public static final RegistryObject<ArmorItem> TAMMETHYST_LEGS = ITEMS.register("tammethyst_leggings", () ->
  70.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.LEGS, new Item.Properties().group(RunicTechnology.TAB))
  71.     );
  72.     public static final RegistryObject<ArmorItem> TAMMETHYST_BOOTS = ITEMS.register("tammethyst_boots", () ->
  73.             new ArmorItem(ModArmorMaterials.TAMMETHYST, EquipmentSlotType.FEET, new Item.Properties().group(RunicTechnology.TAB))
  74.     );
  75.     //endregion
  76.     //endregion
  77.    
  78.     //region Blocks
  79.     public static final RegistryObject<Block> TAMMETHYST_BLOCK = BLOCKS.register("tammethyst_block", TammethystBlock::new);
  80.     public static final RegistryObject<Block> TAMMETHYST_ORE = BLOCKS.register("tammethyst_ore", TammethystOre::new);
  81.     //endregion
  82.    
  83.     //region Block Items
  84.     public static final RegistryObject<Item> TAMMETHYST_BLOCK_ITEM = ITEMS.register("tammethyst_block", () -> new BlockItemBase(TAMMETHYST_BLOCK.get()));
  85.     public static final RegistryObject<Item> TAMMETHYST_ORE_ITEM = ITEMS.register("tammethyst_ore", () -> new BlockItemBase(TAMMETHYST_ORE.get()));
  86.     //endregion
  87. }
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement