aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/api/util/GT_ModHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/java/gregtech/api/util/GT_ModHandler.java')
-rw-r--r--main/java/gregtech/api/util/GT_ModHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/java/gregtech/api/util/GT_ModHandler.java b/main/java/gregtech/api/util/GT_ModHandler.java
index 22759cd057..b657c8ee3f 100644
--- a/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/main/java/gregtech/api/util/GT_ModHandler.java
@@ -1503,7 +1503,10 @@ public class GT_ModHandler {
if(isElectricItem(aStack)&&ic2.api.item.ElectricItem.manager.getCharge(aStack)>1000.0d){
for (int i = 0; i < tPlayer.inventory.mainInventory.length; i++) {
if (GT_Utility.isStackInList(tPlayer.inventory.mainInventory[i], GregTech_API.sSolderingMetalList)) {
- tPlayer.inventory.mainInventory[i].stackSize--;
+ if(tPlayer.inventory.mainInventory[i].stackSize<1)return false;
+ if(tPlayer.inventory.mainInventory[i].stackSize==1){tPlayer.inventory.mainInventory[i]=null;}else{
+ tPlayer.inventory.mainInventory[i].stackSize--;}
+
if (tPlayer.inventoryContainer != null) tPlayer.inventoryContainer.detectAndSendChanges();
if (canUseElectricItem(aStack, 10000)) {
return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer)aPlayer);