use of mods.railcraft.common.util.inventory.wrappers.InventoryMapper in project Railcraft by Railcraft.
the class TileBoilerFireboxSolid method placeSolidBoiler.
public static void placeSolidBoiler(World world, BlockPos pos, int width, int height, boolean highPressure, int water, List<ItemStack> fuel) {
for (MultiBlockPattern pattern : TileBoiler.patterns) {
if (pattern.getPatternHeight() - 3 == height && pattern.getPatternWidthX() - 2 == width) {
Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
blockMapping.put('F', EnumMachineBeta.BOILER_FIREBOX_SOLID.getDefaultState());
blockMapping.put('H', highPressure ? EnumMachineBeta.BOILER_TANK_HIGH_PRESSURE.getDefaultState() : EnumMachineBeta.BOILER_TANK_LOW_PRESSURE.getDefaultState());
TileEntity tile = pattern.placeStructure(world, pos, blockMapping);
if (tile instanceof TileBoilerFireboxSolid) {
TileBoilerFireboxSolid master = (TileBoilerFireboxSolid) tile;
master.tankWater.setFluid(Fluids.WATER.get(water));
InventoryMapper masterFuel = InventoryMapper.make(master.inventory, SLOT_BURN, 4);
for (ItemStack stack : fuel) {
InvTools.moveItemStack(stack, masterFuel);
}
}
return;
}
}
}
Aggregations