OSDN Git Service

GUIのSlot追加
[chemicraft/chemicraft.git] / common / chemicraft / ItemGasCollectingBottle.java
1 package chemicraft;
2
3 import java.util.Random;
4
5 import net.minecraft.src.*;
6
7 public class ItemGasCollectingBottle extends ItemAtomInfoContainer {
8
9         public ItemGasCollectingBottle(int id) {
10                 super(id);
11                 this.setMaxStackSize(1);
12                 this.setMaxDamage(2);
13                 this.setCreativeTab(ChemiCraft.instance.creativeTab);
14         }
15
16         @Override
17         public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
18                 par1ItemStack.damageItem(1, par3EntityPlayer);
19
20                 this.atomInfo.update(par2World, par3EntityPlayer);
21                 if(this.atomInfo.isBelowY(129)){
22                         if(!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.instance.atomsID, 1, 7))){
23                                 par3EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.instance.atomsID, 1, 7));
24                         }
25                 }
26
27                 return par1ItemStack;
28         }
29
30         @Override
31         public String getTextureFile() {
32                 return "/ChemiCraft/items/sprite.png";
33         }
34
35 }