mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-30 05:53:23 +01:00
Fix NPE in StockCounter on autofill/no item found (Fixes #376)
This commit is contained in:
parent
b43454531e
commit
7a1c091c74
@ -54,10 +54,12 @@ public class StockCounterModule implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ItemStack itemTradedByShop = determineItemTradedByShop(event.getSignLine(ITEM_LINE));
|
ItemStack itemTradedByShop = determineItemTradedByShop(event.getSignLine(ITEM_LINE));
|
||||||
|
if (itemTradedByShop != null) {
|
||||||
Inventory chestShopInventory = uBlock.findConnectedContainer(event.getSign()).getInventory();
|
Inventory chestShopInventory = uBlock.findConnectedContainer(event.getSign()).getInventory();
|
||||||
|
|
||||||
event.setSignLine(QUANTITY_LINE, getQuantityLineWithCounter(quantity, itemTradedByShop, chestShopInventory));
|
event.setSignLine(QUANTITY_LINE, getQuantityLineWithCounter(quantity, itemTradedByShop, chestShopInventory));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public static void onInventoryClose(InventoryCloseEvent event) {
|
public static void onInventoryClose(InventoryCloseEvent event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user