Fix potential Engine NPE

If somehow you get an engine with an invalid metadata value, it would
crash.
This commit is contained in:
CovertJaguar 2013-06-12 08:26:52 -07:00
parent e996f64660
commit a949418fab

View file

@ -205,14 +205,12 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
}
public Engine newEngine(int meta) {
if (meta == 0)
return new EngineWood(this);
else if (meta == 1)
if (meta == 1)
return new EngineStone(this);
else if (meta == 2)
return new EngineIron(this);
else
return null;
return new EngineWood(this);
}
@Override