Fix NPE on world load when tileBuffer is not yet fully initialized
This commit is contained in:
parent
21d5ae99c8
commit
744ef7a25b
1 changed files with 4 additions and 1 deletions
|
@ -28,8 +28,11 @@ public class PipeLiquidsSandstone extends Pipe implements IPipeTransportLiquidsH
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int fill(Orientations from, int quantity, int id, boolean doFill) {
|
public int fill(Orientations from, int quantity, int id, boolean doFill) {
|
||||||
|
if (container.tileBuffer == null || container.tileBuffer[from.ordinal()] == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!(container.tileBuffer[from.ordinal()].getTile() instanceof TileGenericPipe))
|
if (!(container.tileBuffer[from.ordinal()].getTile() instanceof TileGenericPipe))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return ((PipeTransportLiquids)this.transport).side[from.ordinal()].fill(quantity, doFill, (short) id);
|
return ((PipeTransportLiquids)this.transport).side[from.ordinal()].fill(quantity, doFill, (short) id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue