remove hard coded paper material

This commit is contained in:
hyperdefined
2025-05-15 18:51:17 -04:00
parent 57ec36d5a7
commit eddaec1543
2 changed files with 2 additions and 3 deletions

View File

@@ -57,7 +57,6 @@ public class AnvilEvent implements Listener {
} }
Material firstSlotMaterial = firstSlot.getType(); Material firstSlotMaterial = firstSlot.getType();
Material secondSlotMaterial = secondSlot.getType();
// make sure the first item is a valid item // make sure the first item is a valid item
if (!toolStats.itemChecker.isValidItem(firstSlotMaterial)) { if (!toolStats.itemChecker.isValidItem(firstSlotMaterial)) {
@@ -67,7 +66,7 @@ public class AnvilEvent implements Listener {
PersistentDataContainer secondSlotContainer = secondSlot.getItemMeta().getPersistentDataContainer(); PersistentDataContainer secondSlotContainer = secondSlot.getItemMeta().getPersistentDataContainer();
// make sure the 2nd item is one of ours // make sure the 2nd item is one of ours
if (secondSlotMaterial != Material.PAPER || !secondSlotContainer.has(toolStats.tokenType, PersistentDataType.STRING)) { if (!secondSlotContainer.has(toolStats.tokenType, PersistentDataType.STRING)) {
return; return;
} }

View File

@@ -40,7 +40,7 @@ public class PrepareCraft implements Listener {
// get the items in the crafting grid // get the items in the crafting grid
ItemStack[] grid = event.getInventory().getMatrix(); ItemStack[] grid = event.getInventory().getMatrix();
for (ItemStack item : grid) { for (ItemStack item : grid) {
if (item == null || item.getType() != Material.PAPER) { if (item == null) {
continue; continue;
} }
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();