Skip to content

Commit

Permalink
fix sidebar remove command bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 19, 2020
1 parent 4ebe6e3 commit 7fb663a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -20,8 +20,6 @@ public class EntityUnleashedScriptEvent extends BukkitScriptEvent implements Lis
//
// @Switch in:<area> to only process the event if it occurred within a specified area.
//
// @Cancellable true
//
// @Triggers when an entity is unleashed.
//
// @Context
Expand Down
Expand Up @@ -317,6 +317,7 @@ public void execute(ScriptEntry scriptEntry) {
scores = ListTag.getListFor(TagManager.tagObject(perScores, context), context);
}
}
boolean removedAny = false;
if (scores != null) {
try {
for (String scoreString : scores) {
Expand All @@ -334,6 +335,7 @@ public void execute(ScriptEntry scriptEntry) {
}
sidebar.setLines(current);
sidebar.sendUpdate();
removedAny = true;
}
if (value != null) {
for (String line : value) {
Expand All @@ -345,8 +347,9 @@ public void execute(ScriptEntry scriptEntry) {
}
sidebar.setLines(current);
sidebar.sendUpdate();
removedAny = true;
}
else {
if (!removedAny) {
sidebar.remove();
sidebars.remove(player.getPlayerEntity().getUniqueId());
}
Expand Down

0 comments on commit 7fb663a

Please sign in to comment.