Add logging to world unload

This commit is contained in:
libraryaddict 2020-11-29 07:12:06 +13:00
parent 789d1b15c7
commit eb9eeca691

View File

@ -255,11 +255,13 @@ public class DisguiseListener implements Listener {
}
@EventHandler
public void onChunkUnload(WorldUnloadEvent event) {
public void onWorldUnload(WorldUnloadEvent event) {
if (!DisguiseConfig.isSaveEntityDisguises()) {
return;
}
int disguisesSaved = 0;
for (Entity entity : event.getWorld().getEntities()) {
if (entity instanceof Player) {
continue;
@ -271,8 +273,13 @@ public class DisguiseListener implements Listener {
continue;
}
disguisesSaved++;
DisguiseUtilities.saveDisguises(entity.getUniqueId(), disguises);
}
if (disguisesSaved > 0) {
DisguiseUtilities.getLogger().info("World unloaded, saved " + disguisesSaved + " disguises");
}
}
@EventHandler