prevent possible dupes with temp blocks

This commit is contained in:
PhanaticD 2018-12-28 21:36:57 -05:00
parent 12dc9f25f3
commit 342498de5f

View file

@ -23,14 +23,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockFormEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
@ -1768,6 +1761,26 @@ public class PKListener implements Listener {
}
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockPistonExtendEvent(final BlockPistonExtendEvent event){
for (Block b : event.getBlocks()) {
if (TempBlock.isTempBlock(b)) {
event.setCancelled(true);
break;
}
}
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockPistonRetractEvent(final BlockPistonRetractEvent event){
for (Block b : event.getBlocks()) {
if (TempBlock.isTempBlock(b)) {
event.setCancelled(true);
break;
}
}
}
public static HashMap<Player, String> getBendingPlayerDeath() {
return BENDING_PLAYER_DEATH;
}