use of minechem.item.element.ElementItem in project Minechem by iopleke.
the class RadiationMoleculeHandler method handleRadiationMoleculeBucket.
public RadiationInfo handleRadiationMoleculeBucket(World world, ItemStack itemStack, IInventory inventory, double x, double y, double z) {
PotionChemical[] decayedChemicals = getDecayedMolecule((MoleculeEnum) ((MinechemBucketItem) itemStack.getItem()).chemical);
for (int i = 0; i < decayedChemicals.length; i++) {
decayedChemicals[i].amount *= 8 * itemStack.stackSize;
}
ItemStack[] items = toItemStacks(decayedChemicals);
for (int i = 1; i < items.length; i++) {
ItemStack stack = MinechemUtil.addItemToInventory(inventory, items[i]);
if (stack != null) {
MinechemUtil.throwItemStack(world, itemStack, x, y, z);
}
}
Item item = items[0].getItem();
if (item instanceof MoleculeItem) {
itemStack.func_150996_a(MinechemBucketHandler.getInstance().buckets.get(FluidHelper.moleculeBlocks.get(FluidHelper.molecules.get(MoleculeItem.getMolecule(items[0])))));
} else if (item instanceof ElementItem) {
itemStack.func_150996_a(MinechemBucketHandler.getInstance().buckets.get(FluidHelper.elementsBlocks.get(FluidHelper.elements.get(ElementItem.getElement(items[0])))));
}
itemStack.stackSize = (items[0].stackSize / 8);
itemStack.setTagCompound(items[0].stackTagCompound);
return ElementItem.initiateRadioactivity(itemStack, world);
}
Aggregations