aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch
new file mode 100644
index 0000000000..58464d61d0
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/BaseFireBlock.java.patch
@@ -0,0 +1,50 @@
+--- a/net/minecraft/world/level/block/BaseFireBlock.java
++++ b/net/minecraft/world/level/block/BaseFireBlock.java
+@@ -132,7 +127,14 @@
+ if (!entity.fireImmune()) {
+ entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
+ if (entity.getRemainingFireTicks() == 0) {
+- entity.setSecondsOnFire(8);
++ // CraftBukkit start
++ org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustByBlockEvent(org.bukkit.craftbukkit.block.CraftBlock.at(level, pos), entity.getBukkitEntity(), 8);
++ level.getCraftServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ entity.setSecondsOnFire(event.getDuration(), false);
++ }
++ // CraftBukkit end
+ }
+ }
+
+@@ -153,15 +154,15 @@
+ }
+ }
+
+- if (!blockstate.canSurvive(level, blockpos)) {
+- level.removeBlock(blockpos, false);
++ if (!state.canSurvive(level, pos)) {
++ fireExtinguished(level, pos); // CraftBukkit - fuel block broke
+ }
+
+ }
+ }
+
+ private static boolean inPortalDimension(Level level) {
+- return level.dimension() == Level.OVERWORLD || level.dimension() == Level.NETHER;
++ return level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.OVERWORLD || level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER; // CraftBukkit - getTypeKey()
+ }
+
+ @Override
+@@ -211,4 +210,12 @@
+ }
+ }
+ }
++
++ // CraftBukkit start
++ protected void fireExtinguished(net.minecraft.world.level.LevelAccessor world, BlockPos position) {
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.defaultBlockState()).isCancelled()) {
++ world.removeBlock(position, false);
++ }
++ }
++ // CraftBukkit end
+ }