use of mcjty.rftoolscontrol.blocks.multitank.MultiTankTileEntity in project RFToolsControl by McJty.
the class ProcessorTileEntity method updateFluidSlotsAvailability.
private void updateFluidSlotsAvailability() {
fluidSlotsAvailable = 0;
for (EnumFacing facing : EnumFacing.values()) {
TileEntity te = getWorld().getTileEntity(getPos().offset(facing));
if (te instanceof MultiTankTileEntity) {
fluidSlotsAvailable |= 1 << facing.ordinal();
}
}
fixCardInfoForSlotAvailability();
markDirty();
}
use of mcjty.rftoolscontrol.blocks.multitank.MultiTankTileEntity in project RFToolsControl by McJty.
the class ProcessorTileEntity method getFluids.
public List<PacketGetFluids.FluidEntry> getFluids() {
List<PacketGetFluids.FluidEntry> pars = new ArrayList<>();
for (int i = 0; i < MAXFLUIDVARS; i++) {
if (isFluidSlotAvailable(i)) {
EnumFacing side = EnumFacing.values()[i / TANKS];
TileEntity te = getWorld().getTileEntity(getPos().offset(side));
if (te instanceof MultiTankTileEntity) {
MultiTankTileEntity mtank = (MultiTankTileEntity) te;
MultiTankFluidProperties[] propertyList = mtank.getProperties();
IFluidTankProperties properties = propertyList[i % TANKS];
FluidStack fluidStack = properties == null ? null : properties.getContents();
pars.add(new PacketGetFluids.FluidEntry(fluidStack, true));
} else {
pars.add(new PacketGetFluids.FluidEntry(null, true));
}
} else {
pars.add(new PacketGetFluids.FluidEntry(null, false));
}
}
return pars;
}
Aggregations