forked from LogBlock/LogBlock
@ -81,19 +81,23 @@ public class WorldEditLoggingHook {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location location = new Location(world, pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
|
Location location = BukkitAdapter.adapt(world, pt);
|
||||||
Block origin = location.getBlock();
|
Block blockBefore = location.getBlock();
|
||||||
Material typeBefore = origin.getType();
|
BlockData blockDataBefore = blockBefore.getBlockData();
|
||||||
|
Material typeBefore = blockDataBefore.getMaterial();
|
||||||
|
|
||||||
// Check to see if we've broken a sign
|
BlockData blockDataNew = BukkitAdapter.adapt(block);
|
||||||
if (BlockStateCodecs.hasCodec(typeBefore)) {
|
|
||||||
plugin.getConsumer().queueBlockBreak(lbActor, origin.getState());
|
if (!blockDataBefore.equals(blockDataNew)) {
|
||||||
} else if (!origin.isEmpty()) {
|
// Check to see if we've broken a sign
|
||||||
plugin.getConsumer().queueBlockBreak(lbActor, location, origin.getBlockData());
|
if (BlockStateCodecs.hasCodec(typeBefore)) {
|
||||||
}
|
plugin.getConsumer().queueBlockBreak(lbActor, blockBefore.getState());
|
||||||
BlockData newBlock = BukkitAdapter.adapt(block);
|
} else if (!BukkitUtils.isEmpty(typeBefore)) {
|
||||||
if (newBlock != null && !BukkitUtils.isEmpty(newBlock.getMaterial())) {
|
plugin.getConsumer().queueBlockBreak(lbActor, location, blockDataBefore);
|
||||||
plugin.getConsumer().queueBlockPlace(lbActor, location, newBlock);
|
}
|
||||||
|
if (!BukkitUtils.isEmpty(blockDataNew.getMaterial())) {
|
||||||
|
plugin.getConsumer().queueBlockPlace(lbActor, location, blockDataNew);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user