From f11024cdf55e88259f641d0572929d9ac6cb7065 Mon Sep 17 00:00:00 2001 From: gamma-delta <29877714+gamma-delta@users.noreply.github.com> Date: Mon, 9 May 2022 10:10:43 -0500 Subject: [PATCH] fire! --- .../blocks/akashic/BlockAkashicLog.java | 8 +++-- .../blocks/decoration/BlockHexDoor.java | 21 +++++++++++++ .../decoration/BlockHexPressurePlate.java | 21 +++++++++++++ .../blocks/decoration/BlockHexSlab.java | 30 +++++++++++++++++++ .../blocks/decoration/BlockHexStairs.java | 20 +++++++++++++ .../blocks/decoration/BlockHexTrapdoor.java | 20 +++++++++++++ .../blocks/decoration/BlockHexWoodButton.java | 21 +++++++++++++ .../hexcasting/common/lib/HexBlocks.java | 14 ++++----- .../petrak/hexcasting/FabricHexInitializer.kt | 7 ++++- 9 files changed, 150 insertions(+), 12 deletions(-) create mode 100644 Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexSlab.java diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicLog.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicLog.java index 11169e89..994db153 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicLog.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicLog.java @@ -1,5 +1,6 @@ package at.petrak.hexcasting.common.blocks.akashic; +import at.petrak.hexcasting.annotations.SoftImplement; import at.petrak.hexcasting.common.blocks.decoration.BlockAxis; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -11,17 +12,18 @@ public class BlockAkashicLog extends BlockAxis { super(props); } - @Override + + @SoftImplement("forge") public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { return true; } - @Override + @SoftImplement("forge") public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { return 5; } - @Override + @SoftImplement("forge") public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { return 5; } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexDoor.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexDoor.java index 355703d0..252faabd 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexDoor.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexDoor.java @@ -1,9 +1,30 @@ package at.petrak.hexcasting.common.blocks.decoration; +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.DoorBlock; +import net.minecraft.world.level.block.state.BlockState; public class BlockHexDoor extends DoorBlock { public BlockHexDoor(Properties $$0) { super($$0); } + + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexPressurePlate.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexPressurePlate.java index eabd966c..e658a0f6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexPressurePlate.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexPressurePlate.java @@ -1,9 +1,30 @@ package at.petrak.hexcasting.common.blocks.decoration; +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.PressurePlateBlock; +import net.minecraft.world.level.block.state.BlockState; public class BlockHexPressurePlate extends PressurePlateBlock { public BlockHexPressurePlate(Sensitivity $$0, Properties $$1) { super($$0, $$1); } + + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexSlab.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexSlab.java new file mode 100644 index 00000000..4f2f21c4 --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexSlab.java @@ -0,0 +1,30 @@ +package at.petrak.hexcasting.common.blocks.decoration; + +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.block.state.BlockState; + +public class BlockHexSlab extends SlabBlock { + public BlockHexSlab(Properties properties) { + super(properties); + } + + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } +} diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexStairs.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexStairs.java index 8dd541de..ab8b1906 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexStairs.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexStairs.java @@ -1,5 +1,9 @@ package at.petrak.hexcasting.common.blocks.decoration; +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.StairBlock; import net.minecraft.world.level.block.state.BlockState; @@ -7,4 +11,20 @@ public class BlockHexStairs extends StairBlock { public BlockHexStairs(BlockState $$0, Properties $$1) { super($$0, $$1); } + + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexTrapdoor.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexTrapdoor.java index 91a5f3e2..68c54ff6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexTrapdoor.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexTrapdoor.java @@ -1,9 +1,29 @@ package at.petrak.hexcasting.common.blocks.decoration; +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.TrapDoorBlock; +import net.minecraft.world.level.block.state.BlockState; public class BlockHexTrapdoor extends TrapDoorBlock { public BlockHexTrapdoor(Properties $$0) { super($$0); } + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexWoodButton.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexWoodButton.java index 21bc0692..856928d3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexWoodButton.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/decoration/BlockHexWoodButton.java @@ -1,9 +1,30 @@ package at.petrak.hexcasting.common.blocks.decoration; +import at.petrak.hexcasting.annotations.SoftImplement; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.WoodButtonBlock; +import net.minecraft.world.level.block.state.BlockState; public class BlockHexWoodButton extends WoodButtonBlock { public BlockHexWoodButton(Properties $$0) { super($$0); } + + + @SoftImplement("forge") + public boolean isFlammable(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return true; + } + + @SoftImplement("forge") + public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 20; + } + + @SoftImplement("forge") + public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return 5; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java index a8e1d2b8..d16abe89 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java @@ -14,7 +14,6 @@ import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockLookingImpetus; import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockRightClickImpetus; import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockStoredPlayerImpetus; import at.petrak.hexcasting.common.blocks.decoration.*; -import at.petrak.hexcasting.xplat.IXplatAbstractions; import com.mojang.datafixers.util.Pair; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; @@ -154,15 +153,14 @@ public class HexBlocks { public static final AmethystBlock AMETHYST_TILES = blockItem("amethyst_tiles", new AmethystBlock(BlockBehaviour.Properties.copy(Blocks.AMETHYST_BLOCK))); public static final Block SCROLL_PAPER = blockItem("scroll_paper", - IXplatAbstractions.INSTANCE.makeFlammable(papery(MaterialColor.TERRACOTTA_WHITE), 100, 60)); + new BlockFlammable(papery(MaterialColor.TERRACOTTA_WHITE), 100, 60)); public static final Block ANCIENT_SCROLL_PAPER = blockItem("ancient_scroll_paper", - IXplatAbstractions.INSTANCE.makeFlammable(papery(MaterialColor.TERRACOTTA_ORANGE), 100, 60)); + new BlockFlammable(papery(MaterialColor.TERRACOTTA_ORANGE), 100, 60)); public static final Block SCROLL_PAPER_LANTERN = blockItem("scroll_paper_lantern", - IXplatAbstractions.INSTANCE.makeFlammable(papery(MaterialColor.TERRACOTTA_WHITE).lightLevel($ -> 15), 100, 60)); + new BlockFlammable(papery(MaterialColor.TERRACOTTA_WHITE).lightLevel($ -> 15), 100, 60)); public static final Block ANCIENT_SCROLL_PAPER_LANTERN = blockItem( "ancient_scroll_paper_lantern", - IXplatAbstractions.INSTANCE.makeFlammable(papery(MaterialColor.TERRACOTTA_ORANGE).lightLevel($ -> 12), 100, - 60)); + new BlockFlammable(papery(MaterialColor.TERRACOTTA_ORANGE).lightLevel($ -> 12), 100, 60)); public static final BlockSconce SCONCE = blockItem("amethyst_sconce", new BlockSconce(BlockBehaviour.Properties.of(Material.AMETHYST, MaterialColor.COLOR_PURPLE) .sound(SoundType.AMETHYST) @@ -170,7 +168,7 @@ public class HexBlocks { .lightLevel($ -> 15))); public static final Block AKASHIC_LOG = blockItem("akashic_log", - new BlockFlammable(akashicWoody(), 5, 5)); + new BlockAkashicLog(akashicWoody())); public static final BlockAxis AKASHIC_LOG_STRIPPED = blockItem("akashic_log_stripped", new BlockAkashicLog(akashicWoody())); public static final Block AKASHIC_WOOD = blockItem("akashic_log", @@ -190,7 +188,7 @@ public class HexBlocks { public static final StairBlock AKASHIC_STAIRS = blockItem("akashic_stairs", new BlockHexStairs(AKASHIC_PLANKS.defaultBlockState(), akashicWoody().noOcclusion())); public static final SlabBlock AKASHIC_SLAB = blockItem("akashic_slab", - new SlabBlock(akashicWoody().noOcclusion())); + new BlockHexSlab(akashicWoody().noOcclusion())); public static final WoodButtonBlock AKASHIC_BUTTON = blockItem("akashic_button", new BlockHexWoodButton(akashicWoody().noOcclusion())); public static final PressurePlateBlock AKASHIC_PRESSURE_PLATE = blockItem("akashic_pressure_plate", diff --git a/Fabric/src/main/java/at/petrak/hexcasting/FabricHexInitializer.kt b/Fabric/src/main/java/at/petrak/hexcasting/FabricHexInitializer.kt index 07f068da..2c2d8226 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/FabricHexInitializer.kt +++ b/Fabric/src/main/java/at/petrak/hexcasting/FabricHexInitializer.kt @@ -81,11 +81,16 @@ object FabricHexInitializer : ModInitializer { HexBlocks.SCROLL_PAPER_LANTERN, HexBlocks.ANCIENT_SCROLL_PAPER, HexBlocks.ANCIENT_SCROLL_PAPER_LANTERN, + + )) { + flameOn.add(papery, 100, 60) + } + for (leaves in listOf( HexBlocks.AKASHIC_LEAVES1, HexBlocks.AKASHIC_LEAVES2, HexBlocks.AKASHIC_LEAVES3, )) { - flameOn.add(papery, 100, 60) + flameOn.add(leaves, 60, 30) } }