Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Improve itemscript error handling more
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 5, 2018
1 parent d081a5d commit 6f4c0b9
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -130,7 +130,7 @@ public void prepValues() {
throw new ErrorInducedException(es);
};
if (Sponge.getRegistry().getType(ItemType.class, title).isPresent()) {
Debug.error("Item script " + title + " may be unusable: a base item type exists with that name!");
Debug.error("Item script may be unusable: a base item type exists with the same name!");
}
if (contents.contains("display name")) {
displayName = Denizen2Core.splitToArgument(contents.getString("display name"), true, true, error);
Expand Down Expand Up @@ -221,7 +221,8 @@ public ItemStack generateItem(CommandQueue queue) {
for (Tuple<String, Argument> input : otherValues) {
Key k = DataKeys.getKeyForName(input.one);
if (k == null) {
throw new ErrorInducedException("Key '" + input.one + "' does not seem to exist.");
queue.error.run("Error handling item script '" + ColorSet.emphasis + title + ColorSet.warning
+ "': key '" + ColorSet.emphasis + input.one + ColorSet.warning + "' does not seem to exist.");
}
DataKeys.tryApply(toRet, k, parseVal(queue, input.two, varBack), queue.error);
}
Expand Down

0 comments on commit 6f4c0b9

Please sign in to comment.