Search in sources :

Example 6 with MultiBlockPattern

use of mods.railcraft.common.blocks.machine.MultiBlockPattern 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;
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) HashMap(java.util.HashMap) InventoryMapper(mods.railcraft.common.util.inventory.wrappers.InventoryMapper) MultiBlockPattern(mods.railcraft.common.blocks.machine.MultiBlockPattern) ItemStack(net.minecraft.item.ItemStack)

Example 7 with MultiBlockPattern

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

the class TileTankWater method placeWaterTank.

public static void placeWaterTank(World world, BlockPos pos, int water) {
    MultiBlockPattern pattern = TileTankWater.patterns.get(0);
    Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
    blockMapping.put('B', EnumMachineAlpha.TANK_WATER.getDefaultState());
    TileEntity tile = pattern.placeStructure(world, pos, blockMapping);
    if (tile instanceof TileTankWater) {
        TileTankWater master = (TileTankWater) tile;
        master.tank.setFluid(Fluids.WATER.get(water));
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) HashMap(java.util.HashMap) MultiBlockPattern(mods.railcraft.common.blocks.machine.MultiBlockPattern)

Example 8 with MultiBlockPattern

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

the class TileFluxTransformer method placeFluxTransformer.

public static void placeFluxTransformer(World world, BlockPos pos) {
    MultiBlockPattern pattern = TileFluxTransformer.patterns.get(0);
    Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
    blockMapping.put('B', EnumMachineEpsilon.FLUX_TRANSFORMER.getDefaultState());
    pattern.placeStructure(world, pos, blockMapping);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) HashMap(java.util.HashMap) MultiBlockPattern(mods.railcraft.common.blocks.machine.MultiBlockPattern)

Example 9 with MultiBlockPattern

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

the class TileTankBase method placeSteelTank.

public static void placeSteelTank(World world, BlockPos pos, int patternIndex, FluidStack fluid) {
    MultiBlockPattern pattern = TileTankBase.patterns.get(patternIndex);
    Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
    blockMapping.put('B', EnumMachineBeta.TANK_STEEL_WALL.getDefaultState());
    blockMapping.put('W', EnumMachineBeta.TANK_STEEL_GAUGE.getDefaultState());
    TileEntity tile = pattern.placeStructure(world, pos, blockMapping);
    if (tile instanceof TileTankBase) {
        TileTankBase master = (TileTankBase) tile;
        master.tank.setFluid(fluid);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) HashMap(java.util.HashMap) MultiBlockPattern(mods.railcraft.common.blocks.machine.MultiBlockPattern)

Example 10 with MultiBlockPattern

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

the class TileBlastFurnace method placeBlastFurnace.

public static void placeBlastFurnace(World world, BlockPos pos, ItemStack input, ItemStack output, ItemStack fuel) {
    MultiBlockPattern pattern = TileBlastFurnace.patterns.get(0);
    Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>();
    blockMapping.put('B', EnumMachineAlpha.BLAST_FURNACE.getDefaultState());
    blockMapping.put('W', EnumMachineAlpha.BLAST_FURNACE.getDefaultState());
    TileEntity tile = pattern.placeStructure(world, pos, blockMapping);
    if (tile instanceof TileBlastFurnace) {
        TileBlastFurnace master = (TileBlastFurnace) tile;
        master.inv.setInventorySlotContents(TileBlastFurnace.SLOT_INPUT, input);
        master.inv.setInventorySlotContents(TileBlastFurnace.SLOT_OUTPUT, output);
        master.inv.setInventorySlotContents(TileBlastFurnace.SLOT_FUEL, fuel);
    }
}
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