mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge pull request #2988 from martinbrom/fix/talisman-of-the-anvil
Fixes NPE when hand is empty while talisman of the anvil triggers
This commit is contained in:
commit
2f27ddc6a6
@ -196,8 +196,8 @@ public class TalismanListener implements Listener {
|
|||||||
PlayerInventory inv = e.getPlayer().getInventory();
|
PlayerInventory inv = e.getPlayer().getInventory();
|
||||||
int slot = inv.getHeldItemSlot();
|
int slot = inv.getHeldItemSlot();
|
||||||
|
|
||||||
// Did the tool in our hand broke or was it an Armorpiece?
|
// Did the tool in our hand break or was it an armor piece?
|
||||||
if (!inv.getItem(inv.getHeldItemSlot()).equals(e.getBrokenItem())) {
|
if (!e.getBrokenItem().equals(inv.getItemInMainHand())) {
|
||||||
for (int s : armorSlots) {
|
for (int s : armorSlots) {
|
||||||
if (e.getBrokenItem().equals(inv.getItem(s))) {
|
if (e.getBrokenItem().equals(inv.getItem(s))) {
|
||||||
slot = s;
|
slot = s;
|
||||||
|
Loading…
Reference in New Issue
Block a user