Skip to content

Commit

Permalink
Flags: if misreading the root of a map, treat as a nonexistent flag
Browse files Browse the repository at this point in the history
instead of the weird stringification
  • Loading branch information
mcmonkey4eva committed Mar 13, 2020
1 parent 6f3b86a commit e93e03f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -16,6 +16,7 @@
import com.denizenscript.denizencore.objects.core.ListTag;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.MemorySection;

import java.util.*;

Expand Down Expand Up @@ -648,7 +649,11 @@ public Flag rebuild() {
this.expiration = (denizen.getSaves().getLong(flagPath + "-expiration"));
}
Object obj = denizen.getSaves().get(flagPath);
if (obj instanceof List) {
if (obj instanceof Map || obj instanceof MemorySection) {
valid = false;
value = new Value();
}
else if (obj instanceof List) {
ArrayList<String> val = new ArrayList<>(((List) obj).size());
for (Object subObj : (List) obj) {
val.add(String.valueOf(subObj));
Expand Down
Expand Up @@ -137,7 +137,7 @@ public void adjust(Mechanism mechanism) {
// @name skull_skin
// @input ElementTag(|ElementTag(|ElementTag))
// @description
// Sets the player skin on a skull_item.
// Sets the player skin on a player_head.
// The first ElementTag is a UUID.
// Optionally, use the second ElementTag for the skin texture cache.
// Optionally, use the third ElementTag for a player name.
Expand Down

0 comments on commit e93e03f

Please sign in to comment.