Search in sources :

Example 6 with RadiationInfo

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;
        }
    }
}
Also used : RadiationInfo(minechem.radiation.RadiationInfo) RadiationEnum(minechem.radiation.RadiationEnum) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 7 with RadiationInfo

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;
}
Also used : RadiationInfo(minechem.radiation.RadiationInfo) RadiationEnum(minechem.radiation.RadiationEnum)

Aggregations

RadiationInfo (minechem.radiation.RadiationInfo)7 RadiationFluidTileEntity (minechem.radiation.RadiationFluidTileEntity)5 TileEntity (net.minecraft.tileentity.TileEntity)5 Block (net.minecraft.block.Block)4 ItemStack (net.minecraft.item.ItemStack)3 RadiationEnum (minechem.radiation.RadiationEnum)2 EnumFacing (net.minecraft.util.EnumFacing)2 World (net.minecraft.world.World)2 Fluid (net.minecraftforge.fluids.Fluid)2 MinechemChemicalType (minechem.item.MinechemChemicalType)1 MinechemBucketItem (minechem.item.bucket.MinechemBucketItem)1 ElementEnum (minechem.item.element.ElementEnum)1 ElementItem (minechem.item.element.ElementItem)1 MoleculeEnum (minechem.item.molecule.MoleculeEnum)1 MoleculeItem (minechem.item.molecule.MoleculeItem)1 Material (net.minecraft.block.material.Material)1 IInventory (net.minecraft.inventory.IInventory)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1