fix: prevent the leaving message from showing even when the player leaving doesn't have the egg
This commit is contained in:
parent
bf50a33b32
commit
952606bf70
1 changed files with 5 additions and 1 deletions
|
|
@ -64,8 +64,12 @@ public class MiscListener implements Listener {
|
|||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onQuit(PlayerQuitEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getInventory().contains(Material.DRAGON_EGG)) {
|
||||
Announcement.announce(String.format("The egg has been dropped as %s left!", player.getName()), logger);
|
||||
}
|
||||
// dropEgg already checks if player has egg
|
||||
EggController.dropEgg(player, data, config);
|
||||
Announcement.announce(String.format("The egg has been dropped as %s left!", player.getName()), logger);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue