use of com.bluepowermod.part.gate.GateBase 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;
}
Aggregations