Search in sources :

Example 1 with PartLamp

use of com.bluepowermod.part.lamp.PartLamp in project BluePower by Qmunity.

the class PartConverterLamp method convert.

@Override
public IPart convert(NBTTagCompound old) {
    String id = old.getString("part_id");
    id = id.replace("cagelamp", "cagelamp.").replace("fixture", "fixture.").replace("silver", "light_gray");
    if (id.startsWith("inverted"))
        id = id.substring("inverted".length()) + ".inverted";
    PartInfo info = PartManager.getPartInfo(id);
    if (info == null)
        return null;
    PartLamp part = (PartLamp) info.create();
    NBTTagCompound data = old.getCompoundTag("partData");
    part.setFace(ForgeDirection.getOrientation(data.getInteger("face")));
    return part;
}
Also used : PartLamp(com.bluepowermod.part.lamp.PartLamp) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) PartInfo(com.bluepowermod.part.PartInfo)

Aggregations

PartInfo (com.bluepowermod.part.PartInfo)1 PartLamp (com.bluepowermod.part.lamp.PartLamp)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1