Block block = event.getBlock();
if (block == null)
return;
BlockLocation blockLocation = new BlockLocation(block.getLocation());
// if this is a placeholder remove it, as it's no longer needed.
if(plugin.getTownyUniverse().isPlaceholder(block)) {
plugin.getTownyUniverse().removePlaceholder(block);
block.setTypeId(0, false);
}
if (plugin.getTownyUniverse().hasProtectionRegenTask(blockLocation)) {
//Cancel any physics events as we will be replacing this block
event.setCancelled(true);
} else {
// Check the block below and cancel the event if that block is going to be replaced.
Block blockBelow = block.getRelative(BlockFace.DOWN);
blockLocation = new BlockLocation(blockBelow.getLocation());
if (plugin.getTownyUniverse().hasProtectionRegenTask(blockLocation)
&& (NeedsPlaceholder.contains(block.getType()))) {
//System.out.print("Cancelling for Below on - " + block.getType().toString());
event.setCancelled(true);