summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorNathan Wolf <nathan@elmakers.com>2017-03-08 14:20:24 -0800
committermd_5 <git@md-5.net>2017-03-11 17:22:12 +1100
commitaa522c91a827f75577976365525e345ea542114b (patch)
tree74518ee47dd917ba70de6c88009a192d0308c0cf /nms-patches
parenteac85911f0f4c4252676515dbc1c4db938dde8df (diff)
downloadcraftbukkit-aa522c91a827f75577976365525e345ea542114b.tar
craftbukkit-aa522c91a827f75577976365525e345ea542114b.tar.gz
craftbukkit-aa522c91a827f75577976365525e345ea542114b.tar.lz
craftbukkit-aa522c91a827f75577976365525e345ea542114b.tar.xz
craftbukkit-aa522c91a827f75577976365525e345ea542114b.zip
Add getIgnitingBlock to BlockBurnEvent
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/BlockFire.patch41
1 files changed, 35 insertions, 6 deletions
diff --git a/nms-patches/BlockFire.patch b/nms-patches/BlockFire.patch
index 9e67ce29..c2fb2103 100644
--- a/nms-patches/BlockFire.patch
+++ b/nms-patches/BlockFire.patch
@@ -48,7 +48,28 @@
return;
}
}
-@@ -172,7 +178,26 @@
+@@ -138,12 +144,14 @@
+ b0 = -50;
+ }
+
+- this.a(world, blockposition.east(), 300 + b0, random, i);
+- this.a(world, blockposition.west(), 300 + b0, random, i);
+- this.a(world, blockposition.down(), 250 + b0, random, i);
+- this.a(world, blockposition.up(), 250 + b0, random, i);
+- this.a(world, blockposition.north(), 300 + b0, random, i);
+- this.a(world, blockposition.south(), 300 + b0, random, i);
++ // CraftBukkit start - add source blockposition to burn calls
++ this.a(world, blockposition.east(), 300 + b0, random, i, blockposition);
++ this.a(world, blockposition.west(), 300 + b0, random, i, blockposition);
++ this.a(world, blockposition.down(), 250 + b0, random, i, blockposition);
++ this.a(world, blockposition.up(), 250 + b0, random, i, blockposition);
++ this.a(world, blockposition.north(), 300 + b0, random, i, blockposition);
++ this.a(world, blockposition.south(), 300 + b0, random, i, blockposition);
++ // CraftBukkit end
+
+ for (int j = -1; j <= 1; ++j) {
+ for (int k = -1; k <= 1; ++k) {
+@@ -172,7 +180,26 @@
l1 = 15;
}
@@ -76,14 +97,22 @@
}
}
}
-@@ -210,6 +235,17 @@
+@@ -204,12 +231,24 @@
+ return integer == null ? 0 : integer.intValue();
+ }
+
+- private void a(World world, BlockPosition blockposition, int i, Random random, int j) {
++ private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
+ int k = this.c(world.getType(blockposition).getBlock());
+
if (random.nextInt(i) < k) {
IBlockData iblockdata = world.getType(blockposition);
+ // CraftBukkit start
+ org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
++ org.bukkit.block.Block sourceBlock = world.getWorld().getBlockAt(sourceposition.getX(), sourceposition.getY(), sourceposition.getZ());
+
-+ BlockBurnEvent event = new BlockBurnEvent(theBlock);
++ BlockBurnEvent event = new BlockBurnEvent(theBlock, sourceBlock);
+ world.getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
@@ -94,7 +123,7 @@
if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
int l = j + random.nextInt(5) / 4;
-@@ -276,7 +312,7 @@
+@@ -276,7 +315,7 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!world.getType(blockposition.down()).r() && !this.c(world, blockposition)) {
@@ -103,7 +132,7 @@
}
}
-@@ -284,7 +320,7 @@
+@@ -284,7 +323,7 @@
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (world.worldProvider.getDimensionManager().getDimensionID() > 0 || !Blocks.PORTAL.b(world, blockposition)) {
if (!world.getType(blockposition.down()).r() && !this.c(world, blockposition)) {
@@ -112,7 +141,7 @@
} else {
world.a(blockposition, (Block) this, this.a(world) + world.random.nextInt(10));
}
-@@ -306,4 +342,12 @@
+@@ -306,4 +345,12 @@
protected BlockStateList getStateList() {
return new BlockStateList(this, new IBlockState[] { BlockFire.AGE, BlockFire.NORTH, BlockFire.EAST, BlockFire.SOUTH, BlockFire.WEST, BlockFire.UPPER});
}