Advertisement
Guest User

Untitled

a guest
Mar 1st, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.95 KB | None | 0 0
  1. package events;
  2.  
  3. import org.apache.logging.log4j.Logger;
  4.  
  5. import com.charles.tutorialmod.main;
  6. import com.charles.tutorialmod.lists.BlockList;
  7. import com.charles.tutorialmod.lists.ItemLists;
  8. import com.charles.tutorialmod.objects.blocks.CustomStairsBlock;
  9.  
  10. import net.minecraft.block.Block;
  11. import net.minecraft.block.SlabBlock;
  12. import net.minecraft.block.SoundType;
  13. import net.minecraft.block.material.Material;
  14. import net.minecraft.item.BlockItem;
  15. import net.minecraft.item.Item;
  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 registerItems(final RegistryEvent.Register<Item> event)
  30.     {
  31.         event.getRegistry().registerAll
  32.         (
  33.                 ItemLists.copper_dust = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("copper_dust")),
  34.                 ItemLists.copper_fragment = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("copper_fragment")),
  35.                 ItemLists.copper_ore = new BlockItem(BlockList.copper_ore, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.copper_ore.getRegistryName()),
  36.                 ItemLists.tutorial_slab = new BlockItem(BlockList.lime_linoleum, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.lime_linoleum.getRegistryName()),
  37.                 ItemLists.tutorial_stairs = new BlockItem(BlockList.lime_linoleum, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.lime_linoleum.getRegistryName()),
  38.                 ItemLists.lime_linoleum = new BlockItem(BlockList.lime_linoleum, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.lime_linoleum.getRegistryName())
  39.     );
  40.     }
  41.    
  42.     @SubscribeEvent
  43.     public static void registerBlocks(final RegistryEvent.Register<Block> event)
  44.     {
  45.         event.getRegistry().registerAll
  46.         (
  47.                 BlockList.copper_ore = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f).harvestLevel(56).sound(SoundType.STONE)).setRegistryName(location("copper_ore")),
  48.                 BlockList.tutorial_slab = new SlabBlock(Block.Properties.from(BlockList.lime_linoleum).hardnessAndResistance(2.0f)).setRegistryName(location("tutorial_slab")),
  49.                 BlockList.tutorial_stairs = new CustomStairsBlock(BlockList.lime_linoleum.getDefaultState(), Block.Properties.from(BlockList.lime_linoleum)).setRegistryName(location("tutorial_stairs")),
  50.                 BlockList.lime_linoleum = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f).sound(SoundType.STONE)).setRegistryName(location("lime_linoleum"))
  51.         );
  52.     }
  53.        
  54.     public static ResourceLocation location(String Name)
  55.     {
  56.         return new ResourceLocation(MOD_ID, Name);
  57.     }
  58.  
  59. }
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement