aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch b/patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch
new file mode 100644
index 0000000000..6712a45f71
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockFireAbstract.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/level/block/BlockFireAbstract.java
++++ b/net/minecraft/world/level/block/BlockFireAbstract.java
+@@ -127,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(world, blockposition), entity.getBukkitEntity(), 8);
++ world.getCraftServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ entity.setSecondsOnFire(event.getDuration(), false);
++ }
++ // CraftBukkit end
+ }
+ }
+
+@@ -148,14 +155,14 @@
+ }
+
+ if (!iblockdata.canSurvive(world, blockposition)) {
+- world.removeBlock(blockposition, false);
++ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
+ }
+
+ }
+ }
+
+ private static boolean inPortalDimension(World world) {
+- return world.dimension() == World.OVERWORLD || world.dimension() == World.NETHER;
++ return world.getTypeKey() == net.minecraft.world.level.dimension.WorldDimension.OVERWORLD || world.getTypeKey() == net.minecraft.world.level.dimension.WorldDimension.NETHER; // CraftBukkit - getTypeKey()
+ }
+
+ @Override
+@@ -203,4 +210,12 @@
+ }
+ }
+ }
++
++ // CraftBukkit start
++ protected void fireExtinguished(net.minecraft.world.level.GeneratorAccess world, BlockPosition position) {
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.defaultBlockState()).isCancelled()) {
++ world.removeBlock(position, false);
++ }
++ }
++ // CraftBukkit end
+ }