Add logging to world unload
This commit is contained in:
parent
789d1b15c7
commit
eb9eeca691
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user