use of minechem.radiation.RadiationInfo in project Minechem by iopleke.
the class ElementItem method getRadiationInfo.
public static RadiationInfo getRadiationInfo(ItemStack element, World world) {
RadiationEnum radioactivity = RadiationInfo.getRadioactivity(element);
if (radioactivity == RadiationEnum.stable) {
return new RadiationInfo(element, radioactivity);
} else {
NBTTagCompound stackTag = element.getTagCompound();
if (stackTag == null) {
return initiateRadioactivity(element, world);
} else {
int dimensionID = stackTag.getInteger("dimensionID");
long lastUpdate = stackTag.getLong("lastUpdate");
long decayStart = stackTag.getLong("decayStart");
RadiationInfo info = new RadiationInfo(element, decayStart, lastUpdate, dimensionID, radioactivity);
return info;
}
}
}
use of minechem.radiation.RadiationInfo in project Minechem by iopleke.
the class ElementItem method initiateRadioactivity.
public static RadiationInfo initiateRadioactivity(ItemStack element, World world) {
RadiationEnum radioactivity = RadiationInfo.getRadioactivity(element);
int dimensionID = world.provider.dimensionId;
long lastUpdate = world.getTotalWorldTime();
RadiationInfo info = new RadiationInfo(element, lastUpdate, lastUpdate, dimensionID, radioactivity);
RadiationInfo.setRadiationInfo(info, element);
return info;
}
Aggregations