From dd584fd2b8d3119c38ec8c88b1aac7d24ea790d4 Mon Sep 17 00:00:00 2001 From: hyperdefined Date: Sun, 26 Jan 2025 13:15:39 -0500 Subject: [PATCH] don't let the player use multiple tokens at once --- src/main/java/lol/hyper/toolstats/events/AnvilEvent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/lol/hyper/toolstats/events/AnvilEvent.java b/src/main/java/lol/hyper/toolstats/events/AnvilEvent.java index e0d8801..809eae4 100644 --- a/src/main/java/lol/hyper/toolstats/events/AnvilEvent.java +++ b/src/main/java/lol/hyper/toolstats/events/AnvilEvent.java @@ -69,12 +69,17 @@ public class AnvilEvent implements Listener { return; } - //get the type from the token + // get the type from the token String tokenType = secondSlotContainer.get(toolStats.tokenType, PersistentDataType.STRING); if (tokenType == null) { return; } + // don't let the player use more than one + if (secondSlot.getAmount() > 1) { + return; + } + // clone the item ItemStack clone = firstSlot.clone();