diff options
Diffstat (limited to 'main/java/gregtech/api')
| -rw-r--r-- | main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 5 | ||||
| -rw-r--r-- | main/java/gregtech/api/util/GT_ModHandler.java | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index ce5b3c629e..9870ba9bec 100644 --- a/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -388,8 +388,9 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE || (getCoverIDAtSide((byte)4) == 0 && worldObj.getPrecipitationHeight(xCoord-1, zCoord ) - 1 < yCoord) || (getCoverIDAtSide((byte)5) == 0 && worldObj.getPrecipitationHeight(xCoord+1, zCoord ) - 1 < yCoord)) { if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { - if (getRandomNumber(10)==0) {doEnergyExplosion(); + if (getRandomNumber(10)==0) { try{GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");}catch(Exception e){} + doEnergyExplosion(); }else setOnFire(); } if (!hasValidMetaTileEntity()) { @@ -397,8 +398,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) { - doEnergyExplosion(); try{GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");}catch(Exception e){} + doEnergyExplosion(); } } } 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); |
