PaperMC/nms-patches/FluidTypeLava.patch

45 lines
2.4 KiB
Diff
Raw Normal View History

2018-07-15 02:00:00 +02:00
--- a/net/minecraft/server/FluidTypeLava.java
+++ b/net/minecraft/server/FluidTypeLava.java
2019-04-23 04:00:00 +02:00
@@ -39,6 +39,13 @@
2018-07-15 02:00:00 +02:00
if (iblockdata.isAir()) {
if (this.a((IWorldReader) world, blockposition1)) {
+ // CraftBukkit start - Prevent lava putting something on fire
2019-04-23 04:00:00 +02:00
+ if (world.getType(blockposition1).getBlock() != Blocks.FIRE) {
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition1, blockposition).isCancelled()) {
+ continue;
+ }
+ }
+ // CraftBukkit end
2020-06-25 02:00:00 +02:00
world.setTypeUpdate(blockposition1, BlockFireAbstract.a((IBlockAccess) world, blockposition1));
2018-07-15 02:00:00 +02:00
return;
}
2019-04-23 04:00:00 +02:00
@@ -55,6 +62,14 @@
2018-07-15 02:00:00 +02:00
}
if (world.isEmpty(blockposition2.up()) && this.b(world, blockposition2)) {
+ // CraftBukkit start - Prevent lava putting something on fire
+ BlockPosition up = blockposition2.up();
2019-04-23 04:00:00 +02:00
+ if (world.getType(up).getBlock() != Blocks.FIRE) {
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, up, blockposition).isCancelled()) {
+ continue;
+ }
+ }
+ // CraftBukkit end
2020-06-25 02:00:00 +02:00
world.setTypeUpdate(blockposition2.up(), BlockFireAbstract.a((IBlockAccess) world, blockposition2));
2018-07-15 02:00:00 +02:00
}
}
2019-04-23 04:00:00 +02:00
@@ -144,7 +159,11 @@
2018-07-15 02:00:00 +02:00
2020-06-25 02:00:00 +02:00
if (this.a((Tag) TagsFluid.LAVA) && fluid1.a((Tag) TagsFluid.WATER)) {
2018-07-15 02:00:00 +02:00
if (iblockdata.getBlock() instanceof BlockFluids) {
- generatoraccess.setTypeAndData(blockposition, Blocks.STONE.getBlockData(), 3);
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(generatoraccess.getMinecraftWorld(), blockposition, Blocks.STONE.getBlockData(), 3)) {
+ return;
+ }
+ // CraftBukkit end
}
this.a(generatoraccess, blockposition);