2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockFireAbstract.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockFireAbstract.java
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -124,7 +124,14 @@
|
|
|
|
if (!entity.fireImmune()) {
|
|
|
|
entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
|
|
|
|
if (entity.getRemainingFireTicks() == 0) {
|
|
|
|
- entity.setSecondsOnFire(8);
|
2020-06-25 02:00:00 +02:00
|
|
|
+ // 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);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ world.getCraftServer().getPluginManager().callEvent(event);
|
2020-06-25 02:00:00 +02:00
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
2021-11-21 23:00:00 +01:00
|
|
|
+ entity.setSecondsOnFire(event.getDuration(), false);
|
2020-06-25 02:00:00 +02:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
entity.hurt(DamageSource.IN_FIRE, this.fireDamage);
|
|
|
|
@@ -146,14 +153,14 @@
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (!iblockdata.canSurvive(world, blockposition)) {
|
|
|
|
- world.removeBlock(blockposition, false);
|
2020-08-11 23:00:00 +02:00
|
|
|
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private static boolean inPortalDimension(World world) {
|
|
|
|
- return world.dimension() == World.OVERWORLD || world.dimension() == World.NETHER;
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.OVERWORLD_LOCATION || world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.NETHER_LOCATION; // CraftBukkit - getTypeKey()
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -201,4 +208,12 @@
|
2021-01-16 02:00:00 +01:00
|
|
|
}
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ 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);
|
2020-06-25 02:00:00 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|