Skip to content

Commit

Permalink
🔨 update and resolve nbtapi method changes
Browse files Browse the repository at this point in the history
Took 2 minutes
  • Loading branch information
kiranhart committed Sep 29, 2023
1 parent cc75f0f commit dd9e5d4
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 @@ -60,8 +60,8 @@ public void onVoucherRedeem(final PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {


final Voucher voucher = Vouchers.getVoucherManager().find(NBT.get(item, nbt -> nbt.getString("Tweetzy:Vouchers")));
final String voucherArgsRaw = NBT.get(item, nbt -> nbt.getString("Tweetzy:VouchersArgs"));
final Voucher voucher = Vouchers.getVoucherManager().find(NBT.get(item, nbt -> (String) nbt.getString("Tweetzy:Vouchers")));
final String voucherArgsRaw = NBT.get(item, nbt -> (String) nbt.getString("Tweetzy:VouchersArgs"));

final List<String> voucherArgs = voucherArgsRaw == null ? null : voucherArgsRaw.split(" ").length == 0 ? null : List.of(voucherArgsRaw.split(" "));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void remove(@NonNull String s) {
public boolean isVoucher(final ItemStack item) {
if (item == null || item.getType() == CompMaterial.AIR.parseMaterial() || item.getAmount() == 0) return false;

return NBT.get(item, nbt -> nbt.hasTag("Tweetzy:Vouchers"));
return NBT.get(item, nbt -> (boolean) nbt.hasTag("Tweetzy:Vouchers"));
}

@Override
Expand Down

0 comments on commit dd9e5d4

Please sign in to comment.