mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-05 22:31:45 +00:00
remove hard coded paper material
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user