Fix potential Engine NPE
If somehow you get an engine with an invalid metadata value, it would crash.
This commit is contained in:
parent
e996f64660
commit
a949418fab
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue