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;
}
Aggregations