Fixed NMS block set to copy tile entity data even if the original block did not change its id or data

This commit is contained in:
zml2008 2012-10-18 19:38:56 -07:00
parent 2221eae36a
commit 877f14f242

View File

@ -216,7 +216,7 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
* @param position position to set the block at
* @param block the block to set
* @param notifyAdjacent true to notify physics and what not
* @return true if set
* @return true if block id or data was changed
*/
public static boolean setSafely(BukkitWorld world, Vector position,
Block block, boolean notifyAdjacent) {
@ -227,14 +227,14 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
CraftWorld craftWorld = ((CraftWorld) world.getWorld());
boolean successful = craftWorld.getHandle().setRawTypeIdAndData(
boolean changed = craftWorld.getHandle().setRawTypeIdAndData(
x, y, z, block.getId(), block.getData());
if (successful) {
if (block instanceof BaseBlock) {
world.copyToWorld(position, (BaseBlock) block);
}
if (changed) {
if (notifyAdjacent) {
craftWorld.getHandle().update(x, y, z, block.getId());
} else {
@ -242,7 +242,7 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
}
}
return successful;
return changed;
}
/**