From 2f50138ba3e39132f5f004abf0fa5b085f0886e7 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 3 Feb 2015 17:46:30 +0000 Subject: [PATCH] Fix BlockIgniteEvent and BlockSpreadEvent being called with the wrong locations in some cases --- nms-patches/BlockFire.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nms-patches/BlockFire.patch b/nms-patches/BlockFire.patch index 2210d8630b..483fa37233 100644 --- a/nms-patches/BlockFire.patch +++ b/nms-patches/BlockFire.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/BlockFire.java 2014-11-28 17:43:42.901707439 +0000 -+++ src/main/java/net/minecraft/server/BlockFire.java 2014-11-28 17:38:22.000000000 +0000 +--- ../work/decompile-8eb82bde//net/minecraft/server/BlockFire.java 2015-02-03 17:46:01.250916418 +0000 ++++ src/main/java/net/minecraft/server/BlockFire.java 2015-02-03 17:46:01.250916418 +0000 @@ -4,6 +4,12 @@ import java.util.Map; import java.util.Random; @@ -38,17 +38,17 @@ - world.setTypeAndData(blockposition1, iblockdata.set(BlockFire.AGE, Integer.valueOf(l1)), 3); + // CraftBukkit start - Call to stop spread of fire + if (world.getType(blockposition1) != Blocks.FIRE) { -+ if (CraftEventFactory.callBlockIgniteEvent(world, i1, k1, j1, i, j, k).isCancelled()) { ++ if (CraftEventFactory.callBlockIgniteEvent(world, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ(), blockposition.getX(), blockposition.getY(), blockposition.getZ()).isCancelled()) { + continue; + } + + org.bukkit.Server server = world.getServer(); + org.bukkit.World bworld = world.getWorld(); -+ org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState(); ++ org.bukkit.block.BlockState blockState = bworld.getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()).getState(); + blockState.setTypeId(Block.getId(this)); + blockState.setData(new org.bukkit.material.MaterialData(Block.getId(this), (byte) l1)); + -+ BlockSpreadEvent spreadEvent = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); ++ BlockSpreadEvent spreadEvent = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), blockState); + server.getPluginManager().callEvent(spreadEvent); + + if (!spreadEvent.isCancelled()) {