Skip to content

Commit

Permalink
better remove command debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 30, 2020
1 parent 16f9921 commit 99ffaeb
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -84,7 +84,8 @@ public void execute(final ScriptEntry scriptEntry) {
List<EntityTag> entities = (List<EntityTag>) scriptEntry.getObject("entities");
WorldTag world = scriptEntry.getObjectTag("world");
if (scriptEntry.dbCallShouldDebug()) {
Debug.report(scriptEntry, getName(), ArgumentHelper.debugList("entities", entities));
Debug.report(scriptEntry, getName(), (world == null ? "" : world.debug())
+ ArgumentHelper.debugList("entities", entities));
}
for (EntityTag entity : entities) {
if (!entity.isGeneric()) {
Expand All @@ -96,11 +97,14 @@ public void execute(final ScriptEntry scriptEntry) {
}
}
else {
int removed = 0;
for (Entity worldEntity : world.getEntities()) {
if (entity.getEntityType().equals(DenizenEntityType.getByEntity(worldEntity))) {
worldEntity.remove();
removed++;
}
}
Debug.echoDebug(scriptEntry, "Removed " + removed + " entities from the world.");
}
}
}
Expand Down

0 comments on commit 99ffaeb

Please sign in to comment.