diff options
author | toastedtruth <brammero@gmail.com> | 2013-12-01 23:42:26 +0000 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2013-12-02 21:03:57 -0700 |
commit | a721fe8473ed5a7c0849231c6d155288fd3e8847 (patch) | |
tree | 423b66c8d410e81c02459b06de84ca7e67212c12 /src/main/java/net/minecraft | |
parent | 803268867ebdabf9d1ed69c0a487899821a3cefc (diff) | |
download | craftbukkit-a721fe8473ed5a7c0849231c6d155288fd3e8847.tar craftbukkit-a721fe8473ed5a7c0849231c6d155288fd3e8847.tar.gz craftbukkit-a721fe8473ed5a7c0849231c6d155288fd3e8847.tar.lz craftbukkit-a721fe8473ed5a7c0849231c6d155288fd3e8847.tar.xz craftbukkit-a721fe8473ed5a7c0849231c6d155288fd3e8847.zip |
Fix BlockCanBuildEvent returning null. Fixes BUKKIT-4972
A Block object is now passed in place of the previous id value, so the
obfuscated name for all subsequent arguments was shifted. As such,
BlockCanBuildEvent was using the incorrect values for both the material
and the location of the event.
This is corrected by swapping the values into the correct order and
providing an id based upon the Block passed into the method.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/World.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 67247f60..0194e74d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -12,6 +12,7 @@ import java.util.concurrent.Callable; // CraftBukkit start import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.craftbukkit.util.LongHashSet; import org.bukkit.craftbukkit.util.UnsafeList; import org.bukkit.generator.ChunkGenerator; @@ -2330,7 +2331,7 @@ public abstract class World implements IBlockAccess { boolean defaultReturn = axisalignedbb != null && !this.a(axisalignedbb, entity) ? false : (block1.getMaterial() == Material.ORIENTABLE && block == Blocks.ANVIL ? true : block1.getMaterial().isReplaceable() && block.canPlace(this, i, j, k, l, itemstack)); // CraftBukkit start - BlockCanBuildEvent event = new BlockCanBuildEvent(this.getWorld().getBlockAt(j, k, l), i, defaultReturn); + BlockCanBuildEvent event = new BlockCanBuildEvent(this.getWorld().getBlockAt(i, j, k), CraftMagicNumbers.getId(block), defaultReturn); this.getServer().getPluginManager().callEvent(event); return event.isBuildable(); |