fix conflicts

This commit is contained in:
Jesse Boyd
2019-07-22 16:39:43 +10:00
56 changed files with 1202 additions and 1057 deletions

View File

@ -199,9 +199,9 @@ public class BukkitWorld extends AbstractWorld {
// We have to restore the block if it was outside
if (!region.contains(pt)) {
editSession.setBlock(pt, history[index]);
editSession.smartSetBlock(pt, history[index]);
} else { // Otherwise fool with history
editSession.setBlock().add(new BlockChange(pt, history[index], editSession.getFullBlock(pt)));
editSession.getChangeSet().add(new BlockChange(pt, history[index], editSession.getFullBlock(pt)));
}
}
}
@ -420,8 +420,21 @@ public class BukkitWorld extends AbstractWorld {
getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally();
}
private static volatile boolean hasWarnedImplError = false;
@Override
public com.sk89q.worldedit.world.block.BlockState getBlock(BlockVector3 position) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
try {
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)).toImmutableState();
} catch (Exception e) {
if (!hasWarnedImplError) {
hasWarnedImplError = true;
logger.warn("Unable to retrieve block via impl adapter", e);
}
}
}
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
}