int y = block.getY();
int z = block.getZ();
String worldName = block.getWorld().getName();
Protection existingProtection = lwc.getPhysicalDatabase().loadProtection(worldName, x, y, z);
if (existingProtection != null) {
event.setProtected(true);
return;
}
LWCProtectionRegisterEvent protectionEvent = new LWCProtectionRegisterEvent(player, block);
lwc.getModuleLoader().dispatchEvent(protectionEvent);
if (protectionEvent.isCancelled()) {
return;
}
Protection protection = lwc.getPhysicalDatabase().registerProtection(block.getTypeId(), Protection.Type.PRIVATE, worldName, player.getName(), "", x, y, z);
if (protection != null) {
event.setProtected(true);
}
}