Advertisement
jayhillx

ModBlock

Aug 5th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.64 KB | None | 0 0
  1. package com.meepshadow.mysticsbiomes.init;
  2.  
  3. import com.meepshadow.mysticsbiomes.MysticsBiomes;
  4. import com.meepshadow.mysticsbiomes.blocks.*;
  5. import com.meepshadow.mysticsbiomes.blocks.CakeBlock;
  6. import com.meepshadow.mysticsbiomes.world.layers.trees.LavenderTree;
  7. import net.minecraft.block.*;
  8. import net.minecraft.block.material.Material;
  9. import net.minecraft.block.material.MaterialColor;
  10. import net.minecraft.potion.Effects;
  11. import net.minecraftforge.common.ToolType;
  12. import net.minecraftforge.fml.RegistryObject;
  13. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  14. import net.minecraftforge.registries.DeferredRegister;
  15. import net.minecraftforge.registries.ForgeRegistries;
  16.  
  17. public class ModBlock {
  18.  
  19. @SuppressWarnings("deprecation")
  20. public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, MysticsBiomes.MOD_ID);
  21.  
  22. // Blocks
  23. public static final RegistryObject<Block> DANDELION_LEAVES = BLOCKS.register("dandelion_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  24. public static final RegistryObject<Block> LEMON_LIME_LEAVES = BLOCKS.register("lemon_lime_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  25. public static final RegistryObject<Block> SEAFOAM_LEAVES = BLOCKS.register("seafoam_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  26. public static final RegistryObject<Block> TROPICAL_LEAVES = BLOCKS.register("tropical_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  27. public static final RegistryObject<Block> STRAWBERRY_LEAVES = BLOCKS.register("strawberry_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  28. public static final RegistryObject<Block> SWEET_STRAWBERRY_LEAVES = BLOCKS.register("sweet_strawberry_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  29. public static final RegistryObject<Block> LAVENDER_LEAVES = BLOCKS.register("lavender_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  30. public static final RegistryObject<Block> MYSTIC_LEAVES = BLOCKS.register("mystic_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
  31.  
  32. public static final RegistryObject<Block> DANDELION_LOG = BLOCKS.register("dandelion_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.YELLOW).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  33. public static final RegistryObject<Block> DANDELION_PLANKS = BLOCKS.register("dandelion_planks", DandelionPlanks::new);
  34. public static final RegistryObject<Block> DANDELION_STAIRS = BLOCKS.register("dandelion_stairs", () -> new StairsBlock(() -> ModBlock.DANDELION_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  35. public static final RegistryObject<Block> DANDELION_SLAB = BLOCKS.register("dandelion_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  36.  
  37. public static final RegistryObject<Block> LEMON_LIME_LOG = BLOCKS.register("lemon_lime_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.LIME).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  38. public static final RegistryObject<Block> LEMON_LIME_PLANKS = BLOCKS.register("lemon_lime_planks", LemonLimePlanks::new);
  39. public static final RegistryObject<Block> LEMON_LIME_STAIRS = BLOCKS.register("lemon_lime_stairs", () -> new StairsBlock(() -> ModBlock.LEMON_LIME_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  40. public static final RegistryObject<Block> LEMON_LIME_SLAB = BLOCKS.register("lemon_lime_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  41.  
  42. public static final RegistryObject<Block> SEAFOAM_LOG = BLOCKS.register("seafoam_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.CYAN).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  43. public static final RegistryObject<Block> SEAFOAM_PLANKS = BLOCKS.register("seafoam_planks", SeaFoamPlanks::new);
  44. public static final RegistryObject<Block> SEAFOAM_STAIRS = BLOCKS.register("seafoam_stairs", () -> new StairsBlock(() -> ModBlock.SEAFOAM_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  45. public static final RegistryObject<Block> SEAFOAM_SLAB = BLOCKS.register("seafoam_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  46.  
  47. public static final RegistryObject<Block> TROPICAL_LOG = BLOCKS.register("tropical_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.BLUE).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  48. public static final RegistryObject<Block> TROPICAL_PLANKS = BLOCKS.register("tropical_planks", TropicalPlanks::new);
  49. public static final RegistryObject<Block> TROPICAL_STAIRS = BLOCKS.register("tropical_stairs", () -> new StairsBlock(() -> ModBlock.TROPICAL_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  50. public static final RegistryObject<Block> TROPICAL_SLAB = BLOCKS.register("tropical_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  51.  
  52. public static final RegistryObject<Block> STRAWBERRY_LOGS = BLOCKS.register("strawberry_logs", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PINK).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  53. public static final RegistryObject<Block> STRAWBERRY_PLANKS = BLOCKS.register("strawberry_planks", StrawberryPlanks::new);
  54. public static final RegistryObject<Block> STRAWBERRY_STAIRS = BLOCKS.register("strawberry_stairs", () -> new StairsBlock(() -> ModBlock.STRAWBERRY_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  55. public static final RegistryObject<Block> STRAWBERRY_SLAB = BLOCKS.register("strawberry_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  56.  
  57. public static final RegistryObject<Block> SWEET_STRAWBERRY_LOG = BLOCKS.register("sweet_strawberry_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PINK).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  58. public static final RegistryObject<Block> STRIPPED_SWEET_STRAWBERRY_LOG = BLOCKS.register("stripped_sweet_strawberry_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PINK).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  59. public static final RegistryObject<Block> SWEET_STRAWBERRY_PLANKS = BLOCKS.register("sweet_strawberry_planks", SweetStrawberryPlanks::new);
  60. public static final RegistryObject<Block> SWEET_STRAWBERRY_STAIRS = BLOCKS.register("sweet_strawberry_stairs", () -> new StairsBlock(() -> ModBlock.SWEET_STRAWBERRY_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  61. public static final RegistryObject<Block> SWEET_STRAWBERRY_SLAB = BLOCKS.register("sweet_strawberry_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  62.  
  63. public static final RegistryObject<Block> LAVENDER_LOG = BLOCKS.register("lavender_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PURPLE).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  64. public static final RegistryObject<Block> LAVENDER_PLANKS = BLOCKS.register("lavender_planks", LavenderPlanks::new);
  65. public static final RegistryObject<Block> LAVENDER_STAIRS = BLOCKS.register("lavender_stairs", () -> new StairsBlock(() -> ModBlock.LAVENDER_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  66. public static final RegistryObject<Block> LAVENDER_SLAB = BLOCKS.register("lavender_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  67.  
  68. public static final RegistryObject<Block> MYSTIC_LOG = BLOCKS.register("mystic_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PURPLE).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
  69. public static final RegistryObject<Block> MYSTIC_PLANKS = BLOCKS.register("mystic_planks", MysticPlanks::new);
  70. public static final RegistryObject<Block> MYSTIC_STAIRS = BLOCKS.register("mystic_stairs", () -> new StairsBlock(() -> ModBlock.MYSTIC_PLANKS.get().getDefaultState(), Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE)));
  71. public static final RegistryObject<Block> MYSTIC_SLAB = BLOCKS.register("mystic_slab", () -> new SlabBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.WOOD)));
  72.  
  73. public static final RegistryObject<Block> LAVENDER = BLOCKS.register("lavender", () -> new ModFlower(Effects.HEALTH_BOOST, 9, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0F).sound(SoundType.PLANT)));
  74. public static final RegistryObject<Block> PINK_TULIP = BLOCKS.register("pink_tulip", () -> new ModFlower(Effects.SPEED, 9, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0F).sound(SoundType.PLANT)));
  75. public static final RegistryObject<Block> STRAWBERRY_CAKE_BLOCK = BLOCKS.register("strawberry_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  76. public static final RegistryObject<Block> CHOCOLATE_CAKE_BLOCK = BLOCKS.register("chocolate_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  77. public static final RegistryObject<Block> VANILLA_CAKE_BLOCK = BLOCKS.register("vanilla_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  78. public static final RegistryObject<Block> PINK_CAKE_BLOCK = BLOCKS.register("pink_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  79. public static final RegistryObject<Block> ORANGE_CAKE_BLOCK = BLOCKS.register("orange_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  80. public static final RegistryObject<Block> YELLOW_CAKE_BLOCK = BLOCKS.register("yellow_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  81. public static final RegistryObject<Block> LIME_CAKE_BLOCK = BLOCKS.register("lime_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  82. public static final RegistryObject<Block> CYAN_CAKE_BLOCK = BLOCKS.register("cyan_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  83. public static final RegistryObject<Block> PURPLE_CAKE_BLOCK = BLOCKS.register("purple_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  84. public static final RegistryObject<Block> MAGENTA_CAKE_BLOCK = BLOCKS.register("magenta_cake", () -> new CakeBlock(Block.Properties.create(Material.CAKE).hardnessAndResistance(0.5F).sound(SoundType.CLOTH)));
  85.  
  86. public static final RegistryObject<Block> SERENE_CRYSTAL_ORE = BLOCKS.register("serene_crystal_ore", () -> new OreBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F).harvestLevel(3).harvestTool(ToolType.PICKAXE)));
  87. public static final RegistryObject<Block> SAPPHIRE_ORE = BLOCKS.register("sapphire_ore", () -> new OreBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F).harvestLevel(2).harvestTool(ToolType.PICKAXE)));
  88.  
  89. public static final RegistryObject<Block> LAVENDER_SAPLING = BLOCKS.register("lavender_sapling", () -> new ModSapling(new LavenderTree(), Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().hardnessAndResistance(0).sound(SoundType.PLANT)));
  90.  
  91.  
  92. }
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement