mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
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:
parent
2221eae36a
commit
877f14f242
@ -216,7 +216,7 @@ public static boolean set(World world, Vector position, BaseBlock block) {
|
||||
* @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 @@ public static boolean setSafely(BukkitWorld world, Vector position,
|
||||
|
||||
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 @@ public static boolean setSafely(BukkitWorld world, Vector position,
|
||||
}
|
||||
}
|
||||
|
||||
return successful;
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user