geforkt von Mirrors/FastAsyncWorldEdit
If we fail to set NBT Data, try it without the adapter/NBT Data
Dieser Commit ist enthalten in:
Ursprung
d11c3ae600
Commit
526aa6cf49
@ -418,7 +418,18 @@ public class BukkitWorld extends AbstractWorld {
|
|||||||
public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException {
|
public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException {
|
||||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight);
|
try {
|
||||||
|
return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight);
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (block instanceof BaseBlock && ((BaseBlock) block).getNbtData() != null) {
|
||||||
|
logger.warning("Tried to set a corrupt tile entity at " + position.toString());
|
||||||
|
logger.warning(((BaseBlock) block).getNbtData().toString());
|
||||||
|
}
|
||||||
|
e.printStackTrace();
|
||||||
|
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||||
|
bukkitBlock.setBlockData(BukkitAdapter.adapt(block), notifyAndLight);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||||
bukkitBlock.setBlockData(BukkitAdapter.adapt(block), notifyAndLight);
|
bukkitBlock.setBlockData(BukkitAdapter.adapt(block), notifyAndLight);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren