Skip to content

Commit

Permalink
Fixed a bug in death event
Browse files Browse the repository at this point in the history
  • Loading branch information
LielAmar committed Mar 8, 2022
1 parent a7f1ffc commit f090180
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ public void onItemFrameInteract(PlayerInteractEntityEvent event) {

@EventHandler (priority = EventPriority.HIGHEST)
public void onDeath(PlayerDeathEvent event) {
if(!this.main.getConfigHandler().getDisabledEvents().getOrDefault(event.getClass(), true)) return;
if(!this.plugin.getConfigHandler().getDisabledEvents().getOrDefault(event.getClass(), true)) return;

if(!this.main.getAuthHandler().needsToAuthenticate(event.getEntity().getUniqueId())) return;
if(!this.plugin.getAuthHandler().needsToAuthenticate(event.getEntity().getUniqueId())) return;

// Don't drop the QR Code item if the player needs to authenticate.
event.getDrops().removeIf(item -> this.main.getAuthHandler().isQRCodeItem(item));
event.getDrops().removeIf(item -> this.plugin.getAuthHandler().isQRCodeItem(item));
}
}

0 comments on commit f090180

Please sign in to comment.