Search in sources :

Example 1 with INoDecay

use of minechem.api.INoDecay in project Minechem by iopleke.

the class RadiationHandler method updateContainerNoDecay.

private void updateContainerNoDecay(EntityPlayer player, Container openContainer, IInventory inventory) {
    INoDecay container = (INoDecay) openContainer;
    List<ItemStack> itemstacks = container.getStorageInventory();
    if (itemstacks != null) {
        for (ItemStack itemstack : itemstacks) {
            if (itemstack != null && (itemstack.getItem() == MinechemItemsRegistration.molecule || itemstack.getItem() == MinechemItemsRegistration.element || itemstack.getItem() instanceof MinechemBucketItem) && RadiationInfo.getRadioactivity(itemstack) != RadiationEnum.stable) {
                RadiationInfo radiationInfo = ElementItem.getRadiationInfo(itemstack, player.worldObj);
                radiationInfo.decayStarted += player.worldObj.getTotalWorldTime() - radiationInfo.lastDecayUpdate;
                radiationInfo.lastDecayUpdate = player.worldObj.getTotalWorldTime();
                RadiationInfo.setRadiationInfo(radiationInfo, itemstack);
            }
        }
    }
    List<ItemStack> playerStacks = container.getPlayerInventory();
    if (playerStacks != null) {
        updateRadiationOnItems(player.worldObj, player, openContainer, inventory, playerStacks);
    }
}
Also used : INoDecay(minechem.api.INoDecay) MinechemBucketItem(minechem.item.bucket.MinechemBucketItem) ItemStack(net.minecraft.item.ItemStack)

Aggregations

INoDecay (minechem.api.INoDecay)1 MinechemBucketItem (minechem.item.bucket.MinechemBucketItem)1 ItemStack (net.minecraft.item.ItemStack)1