Skip to content

Commit

Permalink
sidebar title length cap removal, item enchant warn
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 5, 2020
1 parent 81565b1 commit c327fa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -54,9 +54,6 @@ public int[] getScores() {
}

public final void setTitle(String title) {
if (title.length() > 32) {
title = title.substring(0, 32);
}
if (this.title == null || !this.title.equals(title)) {
this.title = title;
setDisplayName(title);
Expand Down
Expand Up @@ -267,13 +267,15 @@ public ItemTag getItemFrom(TagContext context) {
level = Integer.valueOf(split[1].replace(" ", ""));
enchantment = split[0].replace(" ", "");
}
else {
Debug.echoError("Item script '" + getName() + "' has enchantment '" + enchantment + "' without a level.");
}
// Add enchantment
Enchantment ench = Utilities.getEnchantmentByName(enchantment);
stack.getItemStack().addUnsafeEnchantment(ench, level);
}
catch (Exception ex) {
Debug.echoError("While constructing '" + getName() + "', encountered error: '"
+ enchantment + "' is an invalid enchantment: " + ex.getClass().getName() + ": " + ex.getMessage());
Debug.echoError("While constructing '" + getName() + "', encountered error: '" + enchantment + "' is an invalid enchantment: " + ex.getClass().getName() + ": " + ex.getMessage());
if (Debug.verbose) {
Debug.echoError(ex);
}
Expand Down

0 comments on commit c327fa3

Please sign in to comment.