Add logging to world unload
This commit is contained in:
parent
789d1b15c7
commit
eb9eeca691
@ -255,11 +255,13 @@ public class DisguiseListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChunkUnload(WorldUnloadEvent event) {
|
public void onWorldUnload(WorldUnloadEvent event) {
|
||||||
if (!DisguiseConfig.isSaveEntityDisguises()) {
|
if (!DisguiseConfig.isSaveEntityDisguises()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int disguisesSaved = 0;
|
||||||
|
|
||||||
for (Entity entity : event.getWorld().getEntities()) {
|
for (Entity entity : event.getWorld().getEntities()) {
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
continue;
|
continue;
|
||||||
@ -271,8 +273,13 @@ public class DisguiseListener implements Listener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disguisesSaved++;
|
||||||
DisguiseUtilities.saveDisguises(entity.getUniqueId(), disguises);
|
DisguiseUtilities.saveDisguises(entity.getUniqueId(), disguises);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (disguisesSaved > 0) {
|
||||||
|
DisguiseUtilities.getLogger().info("World unloaded, saved " + disguisesSaved + " disguises");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
Loading…
Reference in New Issue
Block a user