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