diff --git a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index 851387e29d6..cb05b51da7e 100644 --- a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -80,7 +80,7 @@ public abstract static class BlockStateBase extends StateHolder { private final int lightEmission; private final boolean useShapeForLightOcclusion; -@@ -523,12 +_,14 @@ +@@ -523,14 +_,18 @@ return this.useShapeForLightOcclusion; } @@ -95,7 +95,11 @@ + return this.getBlock().isAir((BlockState)this); } ++ /** @deprecated Neo: Use {@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#ignitedByLava(BlockGetter, BlockPos, Direction)} instead */ ++ @Deprecated public boolean ignitedByLava() { + return this.ignitedByLava; + } @@ -541,9 +_,11 @@ } diff --git a/patches/net/minecraft/world/level/material/LavaFluid.java.patch b/patches/net/minecraft/world/level/material/LavaFluid.java.patch index 22bbfb96e8e..b91e1b385ce 100644 --- a/patches/net/minecraft/world/level/material/LavaFluid.java.patch +++ b/patches/net/minecraft/world/level/material/LavaFluid.java.patch @@ -46,7 +46,7 @@ + return false; + } + BlockState state = level.getBlockState(pos); -+ return state.ignitedByLava() && state.isFlammable(level, pos, face); ++ return state.ignitedByLava(level, pos, face); + } + @Nullable diff --git a/src/main/java/net/neoforged/neoforge/common/extensions/IBlockExtension.java b/src/main/java/net/neoforged/neoforge/common/extensions/IBlockExtension.java index 98d035d43c6..a0faaa974c5 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IBlockExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IBlockExtension.java @@ -156,6 +156,19 @@ default int getLightEmission(BlockState state, BlockGetter level, BlockPos pos) return state.getLightEmission(); } + /** + * Called when lava is updating, checks if a block face can catch fire from lava. + * + * @param state The current state + * @param level The current level + * @param pos Block position in level + * @param direction The direction that the fire is coming from + * @return True if the face can catch fire from lava, false otherwise. + */ + default boolean ignitedByLava(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return state.ignitedByLava(); + } + /** * Checks if a player or entity can use this block to 'climb' like a ladder. * diff --git a/src/main/java/net/neoforged/neoforge/common/extensions/IBlockStateExtension.java b/src/main/java/net/neoforged/neoforge/common/extensions/IBlockStateExtension.java index fdcd8eee097..bae77cb32fe 100644 --- a/src/main/java/net/neoforged/neoforge/common/extensions/IBlockStateExtension.java +++ b/src/main/java/net/neoforged/neoforge/common/extensions/IBlockStateExtension.java @@ -91,6 +91,18 @@ default int getLightEmission(BlockGetter level, BlockPos pos) { return self().getBlock().getLightEmission(self(), level, pos); } + /** + * Called when lava is updating, checks if a block face can catch fire from lava. + * + * @param level The current level + * @param pos Block position in level + * @param face The face that the fire is coming from + * @return True if the face can catch fire from lava, false otherwise. + */ + default boolean ignitedByLava(BlockGetter level, BlockPos pos, Direction face) { + return self().getBlock().ignitedByLava(self(), level, pos, face); + } + /** * Checks if a player or entity can use this block to 'climb' like a ladder. *