Advertisement
jayhillx

Fire Classes

May 2nd, 2021
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. ~~~~~~~~~~~~DataUtils~~~~~~~~~~~~~
  2. public static void registerFlammable(Block block, int encouragement, int flammability) {
  3. FireUtils fire = (FireUtils) Blocks.FIRE;
  4. fire.setFireInfo(block, encouragement, flammability);
  5. }
  6.  
  7. ~~~~~~~~~~~~FireUtils~~~~~~~~~~~~~
  8. public class FireUtils extends FireBlock {
  9. protected static final Object2IntMap<Block> encouragements = new Object2IntOpenHashMap<>();
  10. protected static final Object2IntMap<Block> flammabilities = new Object2IntOpenHashMap<>();
  11. public FireUtils(Properties builder) {
  12. super(builder);
  13. }
  14.  
  15. public void setFireInfo(Block blockIn, int encouragement, int flammability) {
  16. if (blockIn == Blocks.AIR) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
  17. FireUtils.encouragements.put(blockIn, encouragement);
  18. FireUtils.flammabilities.put(blockIn, flammability);
  19. }
  20.  
  21. }
  22.  
  23. ~~~~~~~~~RegisterCommon~~~~~~~~~~
  24. public static void registerFlammables() {
  25. // Wood & Trees
  26. DataUtils.registerFlammable(ModBlocks.LAVENDER_PLANKS.get(), 5, 20);
  27. DataUtils.registerFlammable(ModBlocks.CHERRY_PLANKS.get(), 5, 20);
  28. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_PLANKS.get(), 5, 20);
  29. DataUtils.registerFlammable(ModBlocks.LAVENDER_STAIRS.get(), 5, 20);
  30. DataUtils.registerFlammable(ModBlocks.CHERRY_STAIRS.get(), 5, 20);
  31. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_STAIRS.get(), 5, 20);
  32. DataUtils.registerFlammable(ModBlocks.LAVENDER_SLAB.get(), 5, 20);
  33. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_SLAB.get(), 5, 20);
  34. DataUtils.registerFlammable(ModBlocks.CHERRY_SLAB.get(), 5, 20);
  35. DataUtils.registerFlammable(ModBlocks.LAVENDER_FENCE.get(), 5, 20);
  36. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_FENCE.get(), 5, 20);
  37. DataUtils.registerFlammable(ModBlocks.CHERRY_FENCE.get(), 5, 20);
  38. DataUtils.registerFlammable(ModBlocks.LAVENDER_FENCE_GATE.get(), 5, 20);
  39. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_FENCE_GATE.get(), 5, 20);
  40. DataUtils.registerFlammable(ModBlocks.CHERRY_FENCE_GATE.get(), 5, 20);
  41. DataUtils.registerFlammable(ModBlocks.VERTICAL_LAVENDER_PLANKS.get(), 5, 20);
  42. DataUtils.registerFlammable(ModBlocks.VERTICAL_STRAWBERRY_PLANKS.get(), 5, 20);
  43. DataUtils.registerFlammable(ModBlocks.VERTICAL_CHERRY_PLANKS.get(), 5, 20);
  44. DataUtils.registerFlammable(ModBlocks.VERTICAL_LAVENDER_SLAB.get(), 5, 20);
  45. DataUtils.registerFlammable(ModBlocks.VERTICAL_STRAWBERRY_SLAB.get(), 5, 20);
  46. DataUtils.registerFlammable(ModBlocks.VERTICAL_CHERRY_SLAB.get(), 5, 20);
  47. DataUtils.registerFlammable(ModBlocks.LAVENDER_LOG.get(), 5, 5);
  48. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_LOG.get(), 5, 5);
  49. DataUtils.registerFlammable(ModBlocks.CHERRY_LOG.get(), 5, 5);
  50. DataUtils.registerFlammable(ModBlocks.LAVENDER_WOOD.get(), 5, 5);
  51. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_WOOD.get(), 5, 5);
  52. DataUtils.registerFlammable(ModBlocks.CHERRY_WOOD.get(), 5, 5);
  53. DataUtils.registerFlammable(ModBlocks.STRIPPED_LAVENDER_LOG.get(), 5, 5);
  54. DataUtils.registerFlammable(ModBlocks.STRIPPED_STRAWBERRY_LOG.get(), 5, 5);
  55. DataUtils.registerFlammable(ModBlocks.STRIPPED_CHERRY_LOG.get(), 5, 5);
  56. DataUtils.registerFlammable(ModBlocks.STRIPPED_LAVENDER_WOOD.get(), 5, 5);
  57. DataUtils.registerFlammable(ModBlocks.STRIPPED_STRAWBERRY_WOOD.get(), 5, 5);
  58. DataUtils.registerFlammable(ModBlocks.STRIPPED_CHERRY_WOOD.get(), 5, 5);
  59. // Leaves
  60. DataUtils.registerFlammable(ModBlocks.LAVENDER_BLOSSOM_LEAVES.get(), 30, 60);
  61. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_BLOSSOM_LEAVES.get(), 30, 60);
  62. DataUtils.registerFlammable(ModBlocks.SWEET_BLOSSOM_LEAVES.get(), 30, 60);
  63. DataUtils.registerFlammable(ModBlocks.PINK_CHERRY_BLOSSOM_LEAVES.get(), 30, 60);
  64. DataUtils.registerFlammable(ModBlocks.WHITE_CHERRY_BLOSSOM_LEAVES.get(), 30, 60);
  65. DataUtils.registerFlammable(ModBlocks.LAVENDER_BLOSSOM_LEAF_CARPET.get(), 30, 60);
  66. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_BLOSSOM_LEAF_CARPET.get(), 30, 60);
  67. DataUtils.registerFlammable(ModBlocks.SWEET_BLOSSOM_LEAF_CARPET.get(), 30, 60);
  68. DataUtils.registerFlammable(ModBlocks.PINK_CHERRY_BLOSSOM_LEAF_CARPET.get(), 30, 60);
  69. DataUtils.registerFlammable(ModBlocks.WHITE_CHERRY_BLOSSOM_LEAF_CARPET.get(), 30, 60);
  70. // Flowers & Nature
  71. DataUtils.registerFlammable(ModBlocks.LAVENDER.get(), 60, 100);
  72. DataUtils.registerFlammable(ModBlocks.WHITE_WILDFLOWER.get(), 60, 100);
  73. DataUtils.registerFlammable(ModBlocks.PINK_WILDFLOWER.get(), 60, 100);
  74. DataUtils.registerFlammable(ModBlocks.STRAWBERRY_BUSH.get(), 60, 100);
  75. }
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement