Guest User

ItemList

a guest
Aug 1st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. package com.author.example.lists;
  2.  
  3. import com.author.example.Main;
  4. import net.minecraft.item.*;
  5. import net.minecraftforge.fml.RegistryObject;
  6. import net.minecraftforge.registries.DeferredRegister;
  7. import net.minecraftforge.registries.ForgeRegistries;
  8.  
  9. public class ItemList {
  10.  
  11. public static final ItemGroup EXAMPLE = Main.EXAMPLE_TAB;
  12. // ItemGroup.MISC for vanilla item groups
  13.  
  14. public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID);
  15.  
  16. public static final RegistryObject<Item> MOD_ORE = ITEMS.register("mod_ore", () -> new Item(new Item.Properties().group(EXAMPLE)));
  17. public static final RegistryObject<Item> MOD_CROP = ITEMS.register("mod_crop", () -> new Item(new Item.Properties().food(FoodList.MOD_CROP).group(EXAMPLE)));
  18. public static final RegistryObject<Item> MOD_SEEDS = ITEMS.register("mod_seeds", () -> new BlockItem(BlockList.MOD_CROP.get(), new Item.Properties().group(EXAMPLE)));
  19. public static final RegistryObject<Item> MOD_BERRIES = ITEMS.register("mod_berry_bush", () -> new BlockItem(BlockList.MOD_BERRY_BUSH.get(), new Item.Properties().food(FoodList.MOD_BERRIES).group(EXAMPLE)));
  20. public static final RegistryObject<Item> MOD_FLUID_BUCKET = ITEMS.register("mod_fluid_bucket", () -> new BucketItem(() -> FluidList.MOD_STILL_FLUID.get(), new Item.Properties().group(EXAMPLE).maxStackSize(1)));
  21.  
  22.  
  23. // Not necessary to create block items here since a subscribe event does this in the main class
  24.  
  25. //public static final RegistryObject<Item> BLOCK_OF_MOD_ORE = ITEMS.register("block_of_mod_ore", () -> new BlockItem(BlockList.BLOCK_OF_MOD_ORE.get(), new Item.Properties().group(EXAMPLE)));
  26. //public static final RegistryObject<Item> MOD_PLANKS = ITEMS.register("mod_planks", () -> new BlockItem(BlockList.MOD_PLANKS.get(), new Item.Properties().group(EXAMPLE)));
  27. //public static final RegistryObject<Item> MOD_SLAB = ITEMS.register("mod_slab", () -> new BlockItem(BlockList.MOD_SLAB.get(), new Item.Properties().group(EXAMPLE)));
  28. //public static final RegistryObject<Item> MOD_STAIRS = ITEMS.register("mod_stairs", () -> new BlockItem(BlockList.MOD_STAIRS.get(), new Item.Properties().group(EXAMPLE)));
  29. //public static final RegistryObject<Item> MOD_WALL = ITEMS.register("mod_wall", () -> new BlockItem(BlockList.MOD_WALL.get(), new Item.Properties().group(EXAMPLE)));
  30.  
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment