mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-25 20:02:23 +00:00
Fixed NPE when player does not have an item in his hand
This commit is contained in:
parent
48eda92079
commit
9f229bbf6a
@ -270,16 +270,18 @@ public class Utils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.getDurability() == 0) {
|
if (item != null) {
|
||||||
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString())) {
|
if (item.getDurability() == 0) {
|
||||||
|
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString() + "." + item.getDurability())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString() + "." + item.getDurability())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user