Skip to content

Commit f95f586

Browse files
committed
v1.3.5.2
1 parent be8ec23 commit f95f586

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/me/byteful/plugin/leveltools/api/item/impl/PDCLevelToolsItem.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ public PDCLevelToolsItem(@NotNull ItemStack stack) {
4040
public @NotNull ItemStack getItemStack() {
4141
final ItemStack stack = LevelToolsUtil.buildItemStack(this.stack, enchantments, getLevel(), getXp(), getMaxXp());
4242

43+
final ItemMeta meta = stack.getItemMeta();
44+
assert meta != null : "ItemMeta is null! Should not happen.";
4345
attributes.forEach((attribute, modifier) -> {
44-
final ItemMeta meta = stack.getItemMeta();
45-
assert meta != null : "ItemMeta is null! Should not happen.";
46-
4746
final Attribute attr = Attribute.valueOf(attribute.replace(".", "_").toUpperCase(Locale.ROOT).trim());
4847
final AttributeModifier mod = new AttributeModifier(attribute, modifier, AttributeModifier.Operation.ADD_NUMBER);
4948
meta.addAttributeModifier(attr, mod);
50-
stack.setItemMeta(meta);
5149
});
50+
stack.setItemMeta(meta);
5251

5352
return stack;
5453
}

src/main/java/me/byteful/plugin/leveltools/util/LevelToolsUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public static void handleReward(LevelToolsItem tool, Player player) {
257257
}
258258
});
259259
}
260+
tool.setLastHandledReward(keyNum);
260261

261262
return;
262263
}

0 commit comments

Comments
 (0)