Fix BlockIgniteEvent and BlockSpreadEvent being called with the wrong locations

in some cases
This commit is contained in:
Thinkofdeath 2015-02-03 17:46:30 +00:00
parent 2173630846
commit 2f50138ba3

View File

@ -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()) {