Make fluid handlers side independent

This commit is contained in:
Ellpeck 2016-12-05 14:16:53 +01:00
parent 413d0dc6fa
commit 1de62f5dc7
4 changed files with 10 additions and 11 deletions

View file

@ -126,7 +126,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IS
@Override @Override
public FluidTank getFluidHandler(EnumFacing facing){ public FluidTank getFluidHandler(EnumFacing facing){
return facing != EnumFacing.UP ? this.tank : null; return this.tank;
} }
@Override @Override

View file

@ -189,7 +189,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
@Override @Override
public FluidTank getFluidHandler(EnumFacing facing){ public FluidTank getFluidHandler(EnumFacing facing){
return facing != EnumFacing.DOWN ? this.tank : null; return this.tank;
} }
@Override @Override

View file

@ -41,6 +41,8 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari
return false; return false;
} }
}; };
private final FluidHandlerFluidMap handlerMap;
public int currentProcessTime; public int currentProcessTime;
private int lastCanola; private int lastCanola;
private int lastOil; private int lastOil;
@ -49,6 +51,10 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari
public TileEntityFermentingBarrel(){ public TileEntityFermentingBarrel(){
super("fermentingBarrel"); super("fermentingBarrel");
this.handlerMap = new FluidHandlerFluidMap();
this.handlerMap.addHandler(InitFluids.fluidCanolaOil, this.canolaTank);
this.handlerMap.addHandler(InitFluids.fluidOil, this.oilTank);
} }
@Override @Override
@ -128,14 +134,7 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari
@Override @Override
public IFluidHandler getFluidHandler(EnumFacing facing){ public IFluidHandler getFluidHandler(EnumFacing facing){
FluidHandlerFluidMap map = new FluidHandlerFluidMap(); return this.handlerMap;
if(facing != EnumFacing.DOWN){
map.addHandler(InitFluids.fluidCanolaOil, this.canolaTank);
}
if(facing != EnumFacing.UP){
map.addHandler(InitFluids.fluidOil, this.oilTank);
}
return map;
} }
@Override @Override

View file

@ -157,7 +157,7 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn
@Override @Override
public IFluidHandler getFluidHandler(EnumFacing facing){ public IFluidHandler getFluidHandler(EnumFacing facing){
return facing != EnumFacing.DOWN ? this.tank : null; return this.tank;
} }
@Override @Override