2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockFireAbstract.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockFireAbstract.java
|
|
|
|
@@ -50,7 +50,14 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
if (!entity.isFireProof()) {
|
|
|
|
entity.setFireTicks(entity.getFireTicks() + 1);
|
|
|
|
if (entity.getFireTicks() == 0) {
|
|
|
|
- entity.setOnFire(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.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ entity.setOnFire(event.getDuration(), false);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
entity.damageEntity(DamageSource.FIRE, this.b);
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -72,14 +79,14 @@
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
if (!iblockdata.canPlace(world, blockposition)) {
|
|
|
|
- world.a(blockposition, false);
|
|
|
|
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean a(World world) {
|
|
|
|
- return world.getDimensionKey() == World.OVERWORLD || world.getDimensionKey() == World.THE_NETHER;
|
2021-03-15 23:00:00 +01:00
|
|
|
+ return world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.OVERWORLD || world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.THE_NETHER; // CraftBukkit - getTypeKey()
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -123,4 +130,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
|
|
|
|
+ protected void fireExtinguished(GeneratorAccess world, BlockPosition position) {
|
|
|
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.getBlockData()).isCancelled()) {
|
|
|
|
+ world.a(position, false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|