1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Fixes NPE when hand is empty while talisman of the anvil triggers

Resolves #2987
This commit is contained in:
Martin Brom 2021-04-24 12:21:36 +02:00
parent 28137be764
commit a6f3696719

View File

@ -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;