// Check if the player can place the block.
Collection<Protection> protections = VanillaPlugin.getInstance().getEngine().getServiceManager().getRegistration(ProtectionService.class).getProvider().getAllProtections(placedBlock.getPosition());
for (Protection p : protections) {
if (p.contains(placedBlock.getPosition()) && !VanillaConfiguration.OPS.isOp(player.getName())) {
refreshClient(player, clickedBlock, clickedFace, rm);
player.sendMessage(ChatStyle.DARK_RED + "This area is a protected spawn point!");
return;
}
}
cause = new PlayerPlacementCause(player, (Material) toPlace, placedBlock);