mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Clean-up some misc. parts of the code
This commit is contained in:
committed by
Matthew Miller
parent
dc21b4df58
commit
8c17aab9c5
@ -413,6 +413,8 @@ 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();
|
||||
@ -420,13 +422,14 @@ public class BukkitWorld extends AbstractWorld {
|
||||
try {
|
||||
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)).toImmutableState();
|
||||
} catch (Exception e) {
|
||||
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
|
||||
if (!hasWarnedImplError) {
|
||||
hasWarnedImplError = true;
|
||||
logger.warn("Unable to retrieve block via impl adapter", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
|
||||
}
|
||||
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user