cjcj55

BlockInit

Oct 29th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.89 KB | None | 0 0
  1. package com.cjcj55.chrispymod.init;
  2.  
  3. import com.cjcj55.chrispymod.ChrispyMod;
  4. import com.cjcj55.chrispymod.objects.blocks.BlockFromOreItem;
  5. import com.cjcj55.chrispymod.objects.blocks.CustomLampBlock;
  6. import com.cjcj55.chrispymod.objects.blocks.ModDoorBlock;
  7.  
  8. import net.minecraft.block.Block;
  9. import net.minecraft.block.LogBlock;
  10. import net.minecraft.block.SlabBlock;
  11. import net.minecraft.block.SoundType;
  12. import net.minecraft.block.StairsBlock;
  13. import net.minecraft.block.WallBlock;
  14. import net.minecraft.block.material.Material;
  15. import net.minecraft.block.material.MaterialColor;
  16. import net.minecraftforge.common.ToolType;
  17. import net.minecraftforge.fml.RegistryObject;
  18. import net.minecraftforge.registries.DeferredRegister;
  19. import net.minecraftforge.registries.ForgeRegistries;
  20.  
  21. public class BlockInit
  22. {
  23. public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, ChrispyMod.MOD_ID);
  24.  
  25. // BLOCKS (FROM ORE)
  26. public static final RegistryObject<Block> RUBY_BLOCK = BLOCKS.register("ruby_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(5.1f, 31.0f).harvestLevel(2)));
  27. public static final RegistryObject<Block> OPAL_BLOCK = BLOCKS.register("opal_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(4.5f, 31.0f).harvestLevel(2)));
  28. public static final RegistryObject<Block> TANGERINE_BLOCK = BLOCKS.register("tangerine_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(5.3f, 31.0f).harvestLevel(2)));
  29. public static final RegistryObject<Block> COBALT_BLOCK = BLOCKS.register("cobalt_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(6.0f, 45.0f).harvestLevel(3)));
  30. public static final RegistryObject<Block> BLUE_EMERALD_BLOCK = BLOCKS.register("blue_emerald_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(9.0f, 50.0f).harvestLevel(3)));
  31. public static final RegistryObject<Block> PARYTH_BLOCK = BLOCKS.register("paryth_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(5.6f, 35.0f).harvestLevel(2)));
  32. public static final RegistryObject<Block> LIGHTNING_BLOCK = BLOCKS.register("lightning_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(8.5f, 40.0f).harvestLevel(2)));
  33. public static final RegistryObject<Block> FLAME_BLOCK = BLOCKS.register("flame_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(5.1f, 40.0f).harvestLevel(2)));
  34. public static final RegistryObject<Block> HARDENED_REDSTONE_BLOCK = BLOCKS.register("hardened_redstone_block", () -> new BlockFromOreItem(Block.Properties.create(Material.IRON).hardnessAndResistance(3.2f, 18.0f).sound(SoundType.METAL).harvestLevel(2)));
  35. // ORES
  36. public static final RegistryObject<Block> RUBY_ORE = BLOCKS.register("ruby_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0f, 15.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  37. public static final RegistryObject<Block> OPAL_ORE = BLOCKS.register("opal_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(3.8f, 12.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(1).sound(SoundType.STONE)));
  38. public static final RegistryObject<Block> TANGERINE_ORE = BLOCKS.register("tangerine_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5.5f, 25.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  39. public static final RegistryObject<Block> COBALT_ORE = BLOCKS.register("cobalt_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(6.5f, 35.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(3).sound(SoundType.STONE)));
  40. public static final RegistryObject<Block> PARYTH_ORE = BLOCKS.register("paryth_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5.5f, 35.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  41. public static final RegistryObject<Block> WHITE_DWARF_STAR_ORE = BLOCKS.register("white_dwarf_star_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(6.0f, 200.0f).sound(SoundType.METAL).harvestLevel(2).harvestTool(ToolType.PICKAXE).sound(SoundType.STONE)));
  42. public static final RegistryObject<Block> NATURAL_ESSENCE_ORE = BLOCKS.register("natural_essence_ore", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 8.0f).sound(SoundType.METAL).harvestLevel(2).harvestTool(ToolType.PICKAXE).sound(SoundType.STONE)));
  43. // NETHER ORES
  44. public static final RegistryObject<Block> RUBY_ORE_NETHER = BLOCKS.register("ruby_ore_nether", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 8.0f).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  45. public static final RegistryObject<Block> FLAME_ORE_NETHER = BLOCKS.register("flame_ore_nether", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 8.0f).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  46. public static final RegistryObject<Block> HELLFIRE_ORE_NETHER = BLOCKS.register("hellfire_ore_nether", () -> new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 8.0f).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
  47. // BRICKS
  48. public static final RegistryObject<Block> SKINNY_SLANTED_BRICKS = BLOCKS.register("skinny_slanted_bricks", () -> new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f, 30.0f).harvestTool(ToolType.PICKAXE).harvestLevel(1).sound(SoundType.STONE)));
  49. public static final RegistryObject<Block> SLANTED_BRICKS = BLOCKS.register("slanted_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  50. public static final RegistryObject<Block> SKINNY_BRICKS = BLOCKS.register("skinny_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  51. public static final RegistryObject<Block> CIRCULAR_BRICKS = BLOCKS.register("circular_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  52. public static final RegistryObject<Block> CRACKED_BRICKS = BLOCKS.register("cracked_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  53. public static final RegistryObject<Block> ENCASED_BRICKS = BLOCKS.register("encased_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  54. public static final RegistryObject<Block> MOSAIC_BRICKS = BLOCKS.register("mosaic_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  55. public static final RegistryObject<Block> ORNATE_BRICKS = BLOCKS.register("ornate_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  56. public static final RegistryObject<Block> ROAD_BRICKS = BLOCKS.register("road_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  57. public static final RegistryObject<Block> SOLID_BRICKS = BLOCKS.register("solid_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  58. public static final RegistryObject<Block> WEAVER_BRICKS = BLOCKS.register("weaver_bricks", () -> new Block(Block.Properties.from(SKINNY_SLANTED_BRICKS.get())));
  59. // REDSTONE LAMPS
  60. public static final RegistryObject<Block> BLACK_REDSTONE_LAMP = BLOCKS.register("black_redstone_lamp", () -> new CustomLampBlock(Block.Properties.create(Material.GLASS).hardnessAndResistance(0.3f, 1.5f).harvestLevel(0).sound(SoundType.GLASS)));
  61. public static final RegistryObject<Block> BLUE_REDSTONE_LAMP = BLOCKS.register("blue_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  62. public static final RegistryObject<Block> BROWN_REDSTONE_LAMP = BLOCKS.register("brown_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  63. public static final RegistryObject<Block> CYAN_REDSTONE_LAMP = BLOCKS.register("cyan_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  64. public static final RegistryObject<Block> GRAY_REDSTONE_LAMP = BLOCKS.register("gray_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  65. public static final RegistryObject<Block> GREEN_REDSTONE_LAMP = BLOCKS.register("green_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  66. public static final RegistryObject<Block> LIGHT_BLUE_REDSTONE_LAMP = BLOCKS.register("light_blue_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  67. public static final RegistryObject<Block> LIGHT_GRAY_REDSTONE_LAMP = BLOCKS.register("light_gray_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  68. public static final RegistryObject<Block> LIME_REDSTONE_LAMP = BLOCKS.register("lime_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  69. public static final RegistryObject<Block> MAGENTA_REDSTONE_LAMP = BLOCKS.register("magenta_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  70. public static final RegistryObject<Block> ORANGE_REDSTONE_LAMP = BLOCKS.register("orange_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  71. public static final RegistryObject<Block> PINK_REDSTONE_LAMP = BLOCKS.register("pink_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  72. public static final RegistryObject<Block> PURPLE_REDSTONE_LAMP = BLOCKS.register("purple_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  73. public static final RegistryObject<Block> RED_REDSTONE_LAMP = BLOCKS.register("red_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  74. public static final RegistryObject<Block> WHITE_REDSTONE_LAMP = BLOCKS.register("white_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  75. public static final RegistryObject<Block> YELLOW_REDSTONE_LAMP = BLOCKS.register("yellow_redstone_lamp", () -> new CustomLampBlock(Block.Properties.from(BLACK_REDSTONE_LAMP.get())));
  76. // MISC BLOCKS
  77. public static final RegistryObject<Block> SUGAR_BLOCK = BLOCKS.register("sugar_block", () -> new Block(Block.Properties.create(Material.BAMBOO).hardnessAndResistance(1.0f, 8.0f).harvestLevel(0).sound(SoundType.SWEET_BERRY_BUSH)));
  78. public static final RegistryObject<Block> SUGAR_CANE_BLOCK = BLOCKS.register("sugar_cane_block", () -> new LogBlock(MaterialColor.GREEN, Block.Properties.create(Material.BAMBOO).hardnessAndResistance(1.2f, 10.0f).harvestTool(ToolType.PICKAXE).harvestLevel(0).sound(SoundType.CROP)));
  79. public static final RegistryObject<Block> BAMBOO_BLOCK = BLOCKS.register("bamboo_block", () -> new LogBlock(MaterialColor.GREEN, Block.Properties.create(Material.BAMBOO).hardnessAndResistance(1.5f, 12.0f).harvestTool(ToolType.AXE).harvestLevel(0).sound(SoundType.BAMBOO)));
  80. public static final RegistryObject<Block> BAMBOO_STAIRS = BLOCKS.register("bamboo_stairs", () -> new StairsBlock(() -> BAMBOO_BLOCK.get().getDefaultState(), Block.Properties.from(BAMBOO_BLOCK.get())));
  81. public static final RegistryObject<Block> BAMBOO_SLAB = BLOCKS.register("bamboo_slab", () -> new SlabBlock(Block.Properties.from(BAMBOO_BLOCK.get())));
  82. public static final RegistryObject<Block> BAMBOO_WALL = BLOCKS.register("bamboo_wall", () -> new WallBlock(Block.Properties.from(BAMBOO_BLOCK.get())));
  83. public static final RegistryObject<Block> BAMBOO_DOOR = BLOCKS.register("bamboo_door", () -> new ModDoorBlock(Block.Properties.from(BAMBOO_BLOCK.get())) {} );
  84.  
  85.  
  86. }
  87.  
Advertisement
Add Comment
Please, Sign In to add comment