Advertisement
Guest User

RegistryEvents error

a guest
Mar 30th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. package com.joakox.miraculousmod.events;
  2.  
  3. import org.apache.logging.log4j.Logger;
  4.  
  5. import com.joakox.miraculousmod.Main;
  6. import com.joakox.miraculousmod.lists.BlockList;
  7. import com.joakox.miraculousmod.lists.ItemList;
  8.  
  9. import net.minecraft.block.Block;
  10. import net.minecraft.block.SlabBlock;
  11. import net.minecraft.block.SoundType;
  12. import net.minecraft.block.material.Material;
  13. import net.minecraft.item.BlockItem;
  14. import net.minecraft.item.Item;
  15. import net.minecraft.item.Item.Properties;
  16. import net.minecraft.item.ItemGroup;
  17. import net.minecraft.util.ResourceLocation;
  18. import net.minecraftforge.event.RegistryEvent;
  19. import net.minecraftforge.eventbus.api.SubscribeEvent;
  20. import net.minecraftforge.fml.common.Mod;
  21.  
  22. @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
  23. public class RegistryEvents {
  24.  
  25. public static final Logger LOGGER = Main.LOGGER;
  26. public static final String MOD_ID = Main.MOD_ID;
  27.  
  28. @SubscribeEvent
  29. public static void registerItem(final RegistryEvent.Register<Item> event) {
  30. event.getRegistry().registerAll(
  31.  
  32. //Ladybug
  33. ItemList.ladybug_yoyo = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("ladybug_yoyo")),
  34. ItemList.ladybug_earring = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("ladybug_earring")),
  35.  
  36. //CatNoir
  37. ItemList.catnoir_cane= new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("catnoir_cane")),
  38. ItemList.catnoir_ring = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("catnoir_ring")),
  39.  
  40. //
  41. ItemList.volpina_flute = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("volpina_flute")),
  42. ItemList.volpina_necklace = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("volpina_necklace")),
  43.  
  44. ItemList.carapace_shield = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("carapace_shield")),
  45. ItemList.carapace_bracalet = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("carapace_bracalet")),
  46.  
  47. ItemList.queenbee_sting = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("queenbee_sting")),
  48. ItemList.queenbee_broach = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("queenbee_broach")),
  49.  
  50. ItemList.hankmoth_singlestick = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("hankmoth_singlestick")),
  51. ItemList.hankmoth_brooch = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("hankmoth_brooch")),
  52.  
  53. ItemList.mayura_fan = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("mayura_fan")),
  54. ItemList.mayura_brooch = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("mayura_brooch")),
  55.  
  56. ItemList.destroyed_block = new BlockItem(BlockList.destroyed_block, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.destroyed_block.getRegistryName()),
  57. ItemList.destroyed_slab = new BlockItem(BlockList.destroyed_slab,new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.destroyed_slab.getRegistryName()),
  58.  
  59. ItemList.ladybug_block = new BlockItem(BlockList.ladybug_block, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.ladybug_block.getRegistryName())
  60. );
  61.  
  62. }
  63.  
  64. @SubscribeEvent
  65. public static void registerBlocks(final RegistryEvent.Register<Block> event) {
  66. event.getRegistry().registerAll(
  67.  
  68. BlockList.destroyed_block= new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE)).setRegistryName(location("destroyed_block")),
  69. BlockList.destroyed_slab= new SlabBlock(Block.Properties.from(BlockList.destroyed_slab)).setRegistryName(location("destroyed_slab")),
  70.  
  71. BlockList.ladybug_block= new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE)).setRegistryName(location("ladybug_block"))
  72.  
  73. );
  74. }
  75.  
  76. public static ResourceLocation location(String name) {
  77.  
  78. return new ResourceLocation(MOD_ID,name);
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement