Skip to content

Commit

Permalink
🔧 tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
LDS-XiaoYe committed Feb 2, 2024
1 parent 6b75765 commit e756591
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

public class PlayerInteractEventListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent interactEvent) {
ItemStack item = interactEvent.getItem();
public void onPlayerInteract(PlayerInteractEvent event) {
ItemStack item = event.getItem();
if (item == null) return;
Player player = interactEvent.getPlayer();
Player player = event.getPlayer();
ClaimedResidence residence = ResidenceApi.getResidenceManager().getByLoc(player.getLocation());
if (residence != null && residence.getPermissions().playerHas(player, Flags.destroy, false)) return;
if (!"create_wrench".equals(item.getType().getKey().getKey())) return;
interactEvent.setCancelled(true);
event.setCancelled(true);
}
}

0 comments on commit e756591

Please sign in to comment.