diff --git a/src/main/java/ca/tweetzy/vouchers/listeners/VoucherListeners.java b/src/main/java/ca/tweetzy/vouchers/listeners/VoucherListeners.java index 26bd2ee..92e6c92 100644 --- a/src/main/java/ca/tweetzy/vouchers/listeners/VoucherListeners.java +++ b/src/main/java/ca/tweetzy/vouchers/listeners/VoucherListeners.java @@ -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 voucherArgs = voucherArgsRaw == null ? null : voucherArgsRaw.split(" ").length == 0 ? null : List.of(voucherArgsRaw.split(" ")); diff --git a/src/main/java/ca/tweetzy/vouchers/model/manager/VoucherManager.java b/src/main/java/ca/tweetzy/vouchers/model/manager/VoucherManager.java index 50d8fdc..9b67cb2 100644 --- a/src/main/java/ca/tweetzy/vouchers/model/manager/VoucherManager.java +++ b/src/main/java/ca/tweetzy/vouchers/model/manager/VoucherManager.java @@ -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