Paper/nms-patches/BlockStationary.patch

41 Zeilen
2.1 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockStationary.java
+++ b/net/minecraft/server/BlockStationary.java
@@ -2,6 +2,8 @@
import java.util.Random;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockStationary extends BlockFluids {
protected BlockStationary(Material material) {
2016-02-29 22:32:46 +01:00
@@ -45,6 +47,13 @@
if (block.material == Material.AIR) {
2016-02-29 22:32:46 +01:00
if (this.c(world, blockposition1)) {
+ // CraftBukkit start - Prevent lava putting something on fire
+ if (world.getType(blockposition1) != Blocks.FIRE) {
+ if (CraftEventFactory.callBlockIgniteEvent(world, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ(), blockposition.getX(), blockposition.getY(), blockposition.getZ()).isCancelled()) {
+ continue;
+ }
+ }
+ // CraftBukkit end
world.setTypeUpdate(blockposition1, Blocks.FIRE.getBlockData());
return;
}
2016-05-10 13:47:39 +02:00
@@ -61,6 +70,14 @@
2016-02-29 22:32:46 +01:00
}
2016-02-29 22:32:46 +01:00
if (world.isEmpty(blockposition2.up()) && this.d(world, blockposition2)) {
+ // CraftBukkit start - Prevent lava putting something on fire
+ BlockPosition up = blockposition2.up();
+ if (world.getType(up) != Blocks.FIRE) {
+ if (CraftEventFactory.callBlockIgniteEvent(world, up.getX(), up.getY(), up.getZ(), blockposition.getX(), blockposition.getY(), blockposition.getZ()).isCancelled()) {
+ continue;
+ }
+ }
+ // CraftBukkit end
world.setTypeUpdate(blockposition2.up(), Blocks.FIRE.getBlockData());
}
}