Search in sources :

Example 11 with MultiBlockPattern

use of mods.railcraft.common.blocks.machine.MultiBlockPattern in project Railcraft by Railcraft.

the class TileCokeOven method placeCokeOven.

public static void placeCokeOven(World world, BlockPos pos, int creosote, ItemStack input, ItemStack output) {
    MultiBlockPattern pattern = TileCokeOven.patterns.get(0);
    Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
    blockMapping.put('B', EnumMachineAlpha.COKE_OVEN.getDefaultState());
    blockMapping.put('W', EnumMachineAlpha.COKE_OVEN.getDefaultState());
    TileEntity tile = pattern.placeStructure(world, pos, blockMapping);
    if (tile instanceof TileCokeOven) {
        TileCokeOven master = (TileCokeOven) tile;
        master.tank.setFluid(Fluids.CREOSOTE.get(creosote));
        master.inv.setInventorySlotContents(TileCokeOven.SLOT_INPUT, input);
        master.inv.setInventorySlotContents(TileCokeOven.SLOT_OUTPUT, output);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) HashMap(java.util.HashMap) MultiBlockPattern(mods.railcraft.common.blocks.machine.MultiBlockPattern)

Aggregations

MultiBlockPattern (mods.railcraft.common.blocks.machine.MultiBlockPattern)11 IBlockState (net.minecraft.block.state.IBlockState)10 TileEntity (net.minecraft.tileentity.TileEntity)9 HashMap (java.util.HashMap)8 ArrayList (java.util.ArrayList)1 InventoryMapper (mods.railcraft.common.util.inventory.wrappers.InventoryMapper)1 ItemStack (net.minecraft.item.ItemStack)1 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)1