mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-15 06:45:11 +01:00
Properly check if item is empty (Fixes #123)
This commit is contained in:
parent
e40865ac26
commit
ae8d1c79e9
@ -81,7 +81,7 @@ public class PlayerInteract implements Listener {
|
|||||||
if (Properties.ALLOW_AUTO_ITEM_FILL && ChatColor.stripColor(sign.getLine(ITEM_LINE)).equals(AUTOFILL_CODE)) {
|
if (Properties.ALLOW_AUTO_ITEM_FILL && ChatColor.stripColor(sign.getLine(ITEM_LINE)).equals(AUTOFILL_CODE)) {
|
||||||
if (canAccess) {
|
if (canAccess) {
|
||||||
ItemStack item = player.getInventory().getItemInMainHand();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
if (item != null) {
|
if (!MaterialUtil.isEmpty(item)) {
|
||||||
String itemCode = MaterialUtil.getSignName(item);
|
String itemCode = MaterialUtil.getSignName(item);
|
||||||
String[] lines = sign.getLines();
|
String[] lines = sign.getLines();
|
||||||
lines[ITEM_LINE] = itemCode;
|
lines[ITEM_LINE] = itemCode;
|
||||||
|
Loading…
Reference in New Issue
Block a user