mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes NPE when hand is empty while talisman of the anvil triggers
Resolves #2987
This commit is contained in:
parent
28137be764
commit
a6f3696719
@ -196,8 +196,8 @@ public class TalismanListener implements Listener {
|
||||
PlayerInventory inv = e.getPlayer().getInventory();
|
||||
int slot = inv.getHeldItemSlot();
|
||||
|
||||
// Did the tool in our hand broke or was it an Armorpiece?
|
||||
if (!inv.getItem(inv.getHeldItemSlot()).equals(e.getBrokenItem())) {
|
||||
// Did the tool in our hand break or was it an armor piece?
|
||||
if (!e.getBrokenItem().equals(inv.getItemInMainHand())) {
|
||||
for (int s : armorSlots) {
|
||||
if (e.getBrokenItem().equals(inv.getItem(s))) {
|
||||
slot = s;
|
||||
|
Loading…
Reference in New Issue
Block a user