Search in sources :

Example 1 with PartInfo

use of com.bluepowermod.part.PartInfo in project BluePower by Qmunity.

the class IconSupplier method onTextureStitch.

@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre event) {
    TextureMap reg = event.map;
    if (reg.getTextureType() == 0) {
        pneumaticTubeSide = reg.registerIcon(Refs.MODID + ":tubes/pneumatic_tube_side");
        pneumaticTubeGlass = reg.registerIcon(Refs.MODID + ":tubes/glass");
        pneumaticTubeGlass2 = reg.registerIcon(Refs.MODID + ":tubes/glass2");
        pneumaticTubeOpaqueSide = reg.registerIcon(Refs.MODID + ":tubes/pneumatic_tube_side_opaque");
        pneumaticTubeOpaqueNode = reg.registerIcon(Refs.MODID + ":tubes/pneumatic_tube_end_opaque");
        restrictionTubeSide = reg.registerIcon(Refs.MODID + ":tubes/restriction_tube_side");
        restrictionTubeNodeOpaque = reg.registerIcon(Refs.MODID + ":tubes/restriction_tube_end_opaque");
        restrictionTubeSideOpaque = reg.registerIcon(Refs.MODID + ":tubes/restriction_tube_side_opaque");
        magTubeSide = reg.registerIcon(Refs.MODID + ":tubes/mag_side");
        magCoilSide = reg.registerIcon(Refs.MODID + ":tubes/mag_casing");
        magCoilFront = reg.registerIcon(Refs.MODID + ":tubes/mag_casing_end");
        magTubeGlass = reg.registerIcon(Refs.MODID + ":tubes/glass_reinforced");
        magTubeGlass2 = reg.registerIcon(Refs.MODID + ":tubes/glass_reinforced2");
        acceleratorFront = reg.registerIcon(Refs.MODID + ":machines/accelerator_front");
        acceleratorFrontPowered = reg.registerIcon(Refs.MODID + ":machines/accelerator_front_powered");
        acceleratorSide = reg.registerIcon(Refs.MODID + ":machines/accelerator_side");
        acceleratorSidePowered = reg.registerIcon(Refs.MODID + ":machines/accelerator_side_powered");
        acceleratorInside = reg.registerIcon(Refs.MODID + ":machines/accelerator_inside");
        pneumaticTubeColoring = reg.registerIcon(Refs.MODID + ":tubes/coloring");
        cagedLampFootSide = reg.registerIcon(Refs.MODID + ":lamps/cage_foot_side");
        cagedLampFootTop = reg.registerIcon(Refs.MODID + ":lamps/cage_foot_top");
        cagedLampCageSide = reg.registerIcon(Refs.MODID + ":lamps/cage");
        cagedLampCageTop = reg.registerIcon(Refs.MODID + ":lamps/cage_top");
        cagedLampLampActive = reg.registerIcon(Refs.MODID + ":lamps/cage_lamp_on");
        cagedLampLampInactive = reg.registerIcon(Refs.MODID + ":lamps/cage_lamp_off");
        cagedLampLampActiveTop = reg.registerIcon(Refs.MODID + ":lamps/cage_lamp_on_top");
        cagedLampLampInactiveTop = reg.registerIcon(Refs.MODID + ":lamps/cage_lamp_off_top");
        fixtureFootSide = reg.registerIcon(Refs.MODID + ":lamps/fixture_foot_side");
        fixtureFootTop = reg.registerIcon(Refs.MODID + ":lamps/fixture_foot_top");
        fixtureLampSideOn = reg.registerIcon(Refs.MODID + ":lamps/fixture_lamp_on");
        fixtureLampTopOn = reg.registerIcon(Refs.MODID + ":lamps/fixture_lamp_on_top");
        fixtureLampSideOff = reg.registerIcon(Refs.MODID + ":lamps/fixture_lamp_off");
        fixtureLampTopOff = reg.registerIcon(Refs.MODID + ":lamps/fixture_lamp_off_top");
        lampOn = reg.registerIcon(Refs.MODID + ":lamps/lamp_off");
        lampOff = reg.registerIcon(Refs.MODID + ":lamps/lamp_on");
        bluestoneTorchOff = reg.registerIcon(Refs.MODID + ":bluestone_torch_off");
        bluestoneTorchOn = reg.registerIcon(Refs.MODID + ":bluestone_torch_on");
        wire = reg.registerIcon(Refs.MODID + ":wire/wire");
        wireInsulation1 = reg.registerIcon(Refs.MODID + ":wire/insulation1");
        wireInsulation2 = reg.registerIcon(Refs.MODID + ":wire/insulation2");
        wireBundledConnection = reg.registerIcon(Refs.MODID + ":wire/bundled_connection");
        wireBundledCross = reg.registerIcon(Refs.MODID + ":wire/bundled_cross");
        wireBundledStraight1 = reg.registerIcon(Refs.MODID + ":wire/bundled_straight_1");
        wireBundledStraight2 = reg.registerIcon(Refs.MODID + ":wire/bundled_straight_2");
        wireBundledSide1 = reg.registerIcon(Refs.MODID + ":wire/bundled_side_1");
        wireBundledSide2 = reg.registerIcon(Refs.MODID + ":wire/bundled_side_2");
        gateButton = reg.registerIcon(Refs.MODID + ":gates/components/button");
        siliconChipOff = reg.registerIcon(Refs.MODID + ":gates/components/silicon_chip_off");
        siliconChipOn = reg.registerIcon(Refs.MODID + ":gates/components/silicon_chip_on");
        taintedSiliconChipOff = reg.registerIcon(Refs.MODID + ":gates/components/tainted_silicon_chip_off");
        taintedSiliconChipOn = reg.registerIcon(Refs.MODID + ":gates/components/tainted_silicon_chip_on");
        quartzResonator = reg.registerIcon(Refs.MODID + ":gates/components/resonator");
        gateSolarPanel = reg.registerIcon(Refs.MODID + ":gates/components/solarpanel");
        for (PartInfo i : PartManager.getRegisteredParts()) i.getExample().registerIcons(reg);
    }
}
Also used : TextureMap(net.minecraft.client.renderer.texture.TextureMap) PartInfo(com.bluepowermod.part.PartInfo) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 2 with PartInfo

use of com.bluepowermod.part.PartInfo in project BluePower by Qmunity.

the class PartConverterTube method convert.

@Override
public IPart convert(NBTTagCompound old) {
    PartInfo info = PartManager.getPartInfo(old.getString("part_id"));
    if (info == null)
        return null;
    PneumaticTube part = (PneumaticTube) info.create();
    part.readFromNBT(old.getCompoundTag("partData"));
    return part;
}
Also used : PneumaticTube(com.bluepowermod.part.tube.PneumaticTube) PartInfo(com.bluepowermod.part.PartInfo)

Example 3 with PartInfo

use of com.bluepowermod.part.PartInfo in project BluePower by Qmunity.

the class PartConverterWire method convert.

@Override
public IPart convert(NBTTagCompound old) {
    String id = old.getString("part_id").replace("bluestoneWire", "wire.bluestone").replace("silver", "light_gray");
    PartInfo info = PartManager.getPartInfo(id);
    if (info == null)
        return null;
    PartRedwireFace part = (PartRedwireFace) info.create();
    NBTTagCompound data = old.getCompoundTag("partData");
    part.setFace(ForgeDirection.getOrientation(data.getInteger("face")));
    return part;
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) PartInfo(com.bluepowermod.part.PartInfo) PartRedwireFace(com.bluepowermod.part.wire.redstone.PartRedwireFace)

Example 4 with PartInfo

use of com.bluepowermod.part.PartInfo in project BluePower by Qmunity.

the class TileCircuitTable method getApplicableItems.

protected List<ItemStack> getApplicableItems() {
    List<ItemStack> gates = new ArrayList<ItemStack>();
    List<PartInfo> registeredParts = PartManager.getRegisteredParts();
    for (PartInfo part : registeredParts) {
        if (part.getExample() instanceof GateBase<?, ?, ?, ?, ?, ?> && ((GateBase<?, ?, ?, ?, ?, ?>) part.getExample()).isCraftableInCircuitTable()) {
            ItemStack partStack = part.getStack().copy();
            gates.add(partStack);
        }
    }
    return gates;
}
Also used : ArrayList(java.util.ArrayList) PartInfo(com.bluepowermod.part.PartInfo) ItemStack(net.minecraft.item.ItemStack)

Example 5 with PartInfo

use of com.bluepowermod.part.PartInfo in project BluePower by Qmunity.

the class PartConverterGate method convert.

@Override
public IPart convert(NBTTagCompound old) {
    String id = old.getString("part_id");
    PartInfo info = PartManager.getPartInfo(id);
    if (info == null)
        return null;
    IPart p = info.create();
    if (!(p instanceof GateBase<?, ?, ?, ?, ?, ?>))
        return null;
    GateBase<?, ?, ?, ?, ?, ?> part = (GateBase<?, ?, ?, ?, ?, ?>) p;
    NBTTagCompound data = old.getCompoundTag("partData");
    part.readFromNBT(data);
    part.setRotation(data.getInteger("rotation") + 2);
    return part;
}
Also used : IPart(uk.co.qmunity.lib.part.IPart) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) PartInfo(com.bluepowermod.part.PartInfo) GateBase(com.bluepowermod.part.gate.GateBase)

Aggregations

PartInfo (com.bluepowermod.part.PartInfo)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 GateBase (com.bluepowermod.part.gate.GateBase)1 PartLamp (com.bluepowermod.part.lamp.PartLamp)1 PneumaticTube (com.bluepowermod.part.tube.PneumaticTube)1 PartRedwireFace (com.bluepowermod.part.wire.redstone.PartRedwireFace)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 ArrayList (java.util.ArrayList)1 TextureMap (net.minecraft.client.renderer.texture.TextureMap)1 ItemStack (net.minecraft.item.ItemStack)1 IPart (uk.co.qmunity.lib.part.IPart)1