Merge pull request #2211 from Dannerick/myDev1

[#2210] fix for NPE on placing an empty gas-burning generator
This commit is contained in:
Aidan 2015-03-16 11:02:30 -04:00
commit 9a704f2812

View file

@ -323,8 +323,9 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
{
fuelTank.read(itemStack.stackTagCompound.getCompoundTag("fuelTank"));
boolean isTankEmpty = (fuelTank.getGas() == null);
//Update energy output based on any existing fuel in tank
FuelGas fuel = FuelHandler.getFuel(fuelTank.getGas().getGas());
FuelGas fuel = (isTankEmpty) ? null : FuelHandler.getFuel(fuelTank.getGas().getGas());
if(fuel != null)
{