use of forestry.core.fluids.tanks.FilteredTank in project ForestryMC by ForestryMC.
the class TileFarmPlain method createInventory.
protected void createInventory() {
setInternalInventory(new TileInventoryAdapter(this, SLOT_COUNT, "Items") {
@Override
public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
if (GuiUtil.isIndexInRange(slotIndex, SLOT_FERTILIZER, SLOT_FERTILIZER_COUNT)) {
return acceptsAsFertilizer(itemStack);
} else if (GuiUtil.isIndexInRange(slotIndex, SLOT_GERMLINGS_1, SLOT_GERMLINGS_COUNT)) {
return acceptsAsGermling(itemStack);
} else if (GuiUtil.isIndexInRange(slotIndex, SLOT_RESOURCES_1, SLOT_RESOURCES_COUNT)) {
return acceptsAsResource(itemStack);
} else if (GuiUtil.isIndexInRange(slotIndex, SLOT_CAN, SLOT_CAN_COUNT)) {
Fluid fluid = FluidHelper.getFluidInContainer(itemStack);
return tankManager.accepts(fluid);
}
return false;
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack stack, int side) {
return GuiUtil.isIndexInRange(slotIndex, SLOT_PRODUCTION_1, SLOT_PRODUCTION_COUNT);
}
});
FilteredTank liquidTank = new FilteredTank(Defaults.PROCESSOR_TANK_CAPACITY, FluidRegistry.WATER);
tankManager = new TankManager(liquidTank);
}
Aggregations