Skip to content

Commit

Permalink
update for core change
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 2, 2022
1 parent 1338785 commit 3ccbd98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Expand Up @@ -1323,11 +1323,7 @@ public static void registerTags() {
if (object.entityScript == null) {
return null;
}
ScriptTag tag = new ScriptTag(object.entityScript);
if (tag.isValid()) {
return tag;
}
return null;
return ScriptTag.valueOf(object.entityScript, CoreUtilities.noDebugContext);
});

// <--[tag]
Expand All @@ -1353,7 +1349,7 @@ public static void registerTags() {
registerSpawnedOnlyTag(ObjectTag.class, "custom_id", (attribute, object) -> {
BukkitImplDeprecations.entityCustomIdTag.warn(attribute.context);
if (CustomNBT.hasCustomNBT(object.getLivingEntity(), "denizen-script-id")) {
return new ScriptTag(CustomNBT.getCustomNBT(object.getLivingEntity(), "denizen-script-id"));
return ScriptTag.valueOf(CustomNBT.getCustomNBT(object.getLivingEntity(), "denizen-script-id"), CoreUtilities.noDebugContext);
}
else {
return new ElementTag(object.getBukkitEntity().getType().name());
Expand Down
Expand Up @@ -70,7 +70,7 @@ public static void registerTags() {
PropertyParser.<InventoryHolder, ScriptTag>registerTag(ScriptTag.class, "script", (attribute, object) -> {
ObjectTag holder = object.inventory.getIdHolder();
if (holder instanceof ScriptTag) {
return (ScriptTag) holder;
return ((ScriptTag) holder).validate();
}
return null;
});
Expand Down
Expand Up @@ -181,8 +181,8 @@ else if (!scriptEntry.hasObject("script")) {
scriptEntry.addObject("path", new ElementTag(scriptName.substring(dotIndex + 1)));
scriptName = scriptName.substring(0, dotIndex);
}
ScriptTag script = new ScriptTag(scriptName);
if (!script.isValid()) {
ScriptTag script = ScriptTag.valueOf(scriptName, CoreUtilities.noDebugContext);
if (script == null) {
arg.reportUnhandled();
}
else {
Expand Down

0 comments on commit 3ccbd98

Please sign in to comment.