mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-09 17:01:37 +01:00
Add preventing spawn debug
This commit is contained in:
parent
675eaffad5
commit
9eb254215f
@ -415,11 +415,13 @@ public class EventListen implements Listener {
|
|||||||
|| event.getReason() == DespawnReason.RELOAD) {
|
|| event.getReason() == DespawnReason.RELOAD) {
|
||||||
if (event.getNPC().getStoredLocation() != null) {
|
if (event.getNPC().getStoredLocation() != null) {
|
||||||
ChunkCoord coord = new ChunkCoord(event.getNPC().getStoredLocation());
|
ChunkCoord coord = new ChunkCoord(event.getNPC().getStoredLocation());
|
||||||
Messaging.debug("Preventing further respawns of", event.getNPC().getId(), "at", coord,
|
if (Messaging.isDebugging()) {
|
||||||
"due to DespawnReason." + event.getReason());
|
Messaging.debug("Preventing further respawns of", event.getNPC().getId(), "at", coord,
|
||||||
|
"due to DespawnReason." + event.getReason());
|
||||||
|
}
|
||||||
toRespawn.remove(coord, event.getNPC());
|
toRespawn.remove(coord, event.getNPC());
|
||||||
}
|
}
|
||||||
} else {
|
} else if (Messaging.isDebugging()) {
|
||||||
Messaging.debug("Removing " + event.getNPC().getId() + " from skin tracker due to DespawnReason."
|
Messaging.debug("Removing " + event.getNPC().getId() + " from skin tracker due to DespawnReason."
|
||||||
+ event.getReason().name());
|
+ event.getReason().name());
|
||||||
}
|
}
|
||||||
@ -451,7 +453,12 @@ public class EventListen implements Listener {
|
|||||||
if (location == null) {
|
if (location == null) {
|
||||||
location = event.getLocation();
|
location = event.getLocation();
|
||||||
}
|
}
|
||||||
toRespawn.remove(new ChunkCoord(location), event.getNPC());
|
ChunkCoord coord = new ChunkCoord(location);
|
||||||
|
if (Messaging.isDebugging()) {
|
||||||
|
Messaging.debug("Preventing further spawns of", event.getNPC().getId(), "at", coord,
|
||||||
|
"due to SpawnReason." + event.getReason());
|
||||||
|
}
|
||||||
|
toRespawn.remove(coord, event.getNPC());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
|
Loading…
Reference in New Issue
Block a user