Skip to content

Commit

Permalink
blocked interacts when player in frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzOverLight committed Jan 18, 2023
1 parent 0464e41 commit 130f1f2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void playerMoveEvent(PlayerMoveEvent e){

@EventHandler
public void playerInteractEvent(PlayerInteractAtEntityEvent e){
if(frozenPlayers.contains(e.getPlayer().getName())) e.setCancelled(true);
if(!(e.getRightClicked() instanceof Player)) return;
if(e.getPlayer().getItemInHand() != PlSticks.FreezeStick) return;
if(PlPerms.hasPerm(e.getPlayer(), PlPerms.Perms.FreezeStick.get())){
Expand Down Expand Up @@ -107,4 +108,9 @@ public void playerLeft(PlayerQuitEvent e){
player.spigot().sendMessage(base);
}
}

@EventHandler
public void playerInteract(PlayerInteractEvent e){
if(frozenPlayers.contains(e.getPlayer().getName())) e.setCancelled(true);
}
}

0 comments on commit 130f1f2

Please sign in to comment.