PaperMC/nms-patches/BlockStationary.patch

43 lines
2.2 KiB
Diff
Raw Normal View History

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-02-29 22:32:46 +01:00
@@ -60,7 +69,16 @@
return;
}
2016-02-29 22:32:46 +01:00
+ // PAIL: rename
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());
}
}