Skip to content

Commit

Permalink
Use correct method for getting a prize
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Apr 27, 2024
1 parent 6b87a94 commit 25e50f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public List<Prize> getPrizes() {
*/
public Prize getPrize(String name) {
for (Prize prize : this.prizes) {
if (prize.getPrizeName().equalsIgnoreCase(name)) return prize;
if (prize.getPrizeNumber().equalsIgnoreCase(name)) return prize;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public String getPrizeNumber() {
public ItemStack getDisplayItem() {
ItemStack itemStack = this.displayItem.build();

itemStack.editMeta(itemMeta -> itemMeta.getPersistentDataContainer().set(PersistentKeys.crate_prize.getNamespacedKey(), PersistentDataType.STRING, this.prizeName));
itemStack.editMeta(itemMeta -> itemMeta.getPersistentDataContainer().set(PersistentKeys.crate_prize.getNamespacedKey(), PersistentDataType.STRING, this.prizeNumber));

return itemStack;
}
Expand All @@ -128,7 +128,7 @@ public ItemStack getDisplayItem() {
public ItemStack getDisplayItem(Player player) {
ItemStack itemStack = this.displayItem.setTarget(player).build();

itemStack.editMeta(itemMeta -> itemMeta.getPersistentDataContainer().set(PersistentKeys.crate_prize.getNamespacedKey(), PersistentDataType.STRING, this.prizeName));
itemStack.editMeta(itemMeta -> itemMeta.getPersistentDataContainer().set(PersistentKeys.crate_prize.getNamespacedKey(), PersistentDataType.STRING, this.prizeNumber));

return itemStack;
}
Expand Down

0 comments on commit 25e50f2

Please sign in to comment.