geforkt von Mirrors/FastAsyncWorldEdit
Fixed NMS block set to copy tile entity data even if the original block did not change its id or data
Dieser Commit ist enthalten in:
Ursprung
2221eae36a
Commit
877f14f242
@ -216,7 +216,7 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
* @param position position to set the block at
|
* @param position position to set the block at
|
||||||
* @param block the block to set
|
* @param block the block to set
|
||||||
* @param notifyAdjacent true to notify physics and what not
|
* @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,
|
public static boolean setSafely(BukkitWorld world, Vector position,
|
||||||
Block block, boolean notifyAdjacent) {
|
Block block, boolean notifyAdjacent) {
|
||||||
@ -227,14 +227,14 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
|
|
||||||
CraftWorld craftWorld = ((CraftWorld) world.getWorld());
|
CraftWorld craftWorld = ((CraftWorld) world.getWorld());
|
||||||
|
|
||||||
boolean successful = craftWorld.getHandle().setRawTypeIdAndData(
|
boolean changed = craftWorld.getHandle().setRawTypeIdAndData(
|
||||||
x, y, z, block.getId(), block.getData());
|
x, y, z, block.getId(), block.getData());
|
||||||
|
|
||||||
if (successful) {
|
if (block instanceof BaseBlock) {
|
||||||
if (block instanceof BaseBlock) {
|
world.copyToWorld(position, (BaseBlock) block);
|
||||||
world.copyToWorld(position, (BaseBlock) block);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
if (notifyAdjacent) {
|
if (notifyAdjacent) {
|
||||||
craftWorld.getHandle().update(x, y, z, block.getId());
|
craftWorld.getHandle().update(x, y, z, block.getId());
|
||||||
} else {
|
} else {
|
||||||
@ -242,7 +242,7 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return successful;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren