import net.minecraft.world.World;
import pcc.chemicraft.ChemiCraft;
import pcc.chemicraft.ChemiCraftAPI;
+import pcc.chemicraft.ChemiCraftData;
import pcc.chemicraft.util.Auxiliary.Probability;
public class ItemGasCollectingBottle extends ItemAtomInfoContainer
public Probability probability = new Probability();
- public ItemGasCollectingBottle(int id) {
+ public ItemGasCollectingBottle(int id)
+ {
super(id);
this.setMaxStackSize(1);
this.setMaxDamage(2);
- this.setCreativeTab(ChemiCraft.instance.creativeTab);
+ this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft);
}
@Override
this.atomInfo.update(par2World, par3EntityPlayer);
- int heightValue = par2World.getHeightValue((int) par3EntityPlayer.posX, (int) par3EntityPlayer.posZ);
+ int heightValue = par2World.getHeightValue((int)par3EntityPlayer.posX, (int)par3EntityPlayer.posZ);
- int result1 = probability.getProbability(99.0D, 1.0D);
- int result2 = probability.getProbability(78.0D, 21.0D, 1.0D);
- int result3 = probability.getProbability(0.032D, 0.0018D, 0.000012D, 0.00052D);
+ int result = probability.getProbability(78.0D, 21.0D, 1.0D, 0.032D, 0.0018D, 0.000012D, 0.00052D, 0.000114D, 0.000087D);
if (this.atomInfo.isOverY(heightValue)) {
- if (result1 == 0) {
- if (result2 == 0) {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 6), par3EntityPlayer);
- } else if (result2 == 1) {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 7), par3EntityPlayer);
- } else {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par3EntityPlayer);
- }
+ if (result == 0) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.NITROGEN), par3EntityPlayer);
+ } else if (result == 1) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.OXYGEN), par3EntityPlayer);
+ } else if (result == 2) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.ARGON), par3EntityPlayer);
+ } else if (result == 3) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonDioxide")), par3EntityPlayer);
+ } else if (result == 4) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.NEON), par3EntityPlayer);
+ } else if (result == 5) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonMonoxide")), par3EntityPlayer);
+ } else if (result == 6) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.LITHIUM), par3EntityPlayer);
+ } else if (result == 7) {
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.KRYPTON), par3EntityPlayer);
} else {
- if (result3 == 0) {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.instance().getCompound("CarbonDioxide")), par3EntityPlayer);
- } else if (result3 == 1) {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 9), par3EntityPlayer);
- } else if (result3 == 2) {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, 1), par3EntityPlayer);
- } else {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 1), par3EntityPlayer);
- }
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, ChemiCraftData.XENON), par3EntityPlayer);
}
}
int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
Block uniqueBlock = Block.blocksList[uniqueBlockID];
- if (uniqueBlock instanceof BlockFire){
+ if (uniqueBlock instanceof BlockFire) {
par1ItemStack.damageItem(1, par2EntityPlayer);
int result1 = probability.getProbability(99, 1);