OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / item / ItemDust.java
1 package pcc.chemicraft.item;
2
3 import pcc.chemicraft.ChemiCraft;
4 import pcc.chemicraft.entity.EntityDust;
5 import net.minecraft.creativetab.CreativeTabs;
6 import net.minecraft.entity.player.EntityPlayer;
7 import net.minecraft.item.Item;
8 import net.minecraft.item.ItemStack;
9 import net.minecraft.world.World;
10
11 public class ItemDust extends Item {
12
13         public ItemDust(int par1) {
14                 super(par1);
15                 this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft);
16         }
17
18         @Override
19         public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
20                         EntityPlayer par3EntityPlayer) {
21
22
23                 if (!par2World.isRemote) {
24                         par2World.spawnEntityInWorld(new EntityDust(par2World,
25                                         par3EntityPlayer.posX,
26                                         par3EntityPlayer.posY,
27                                         par3EntityPlayer.posZ));
28                         par1ItemStack.stackSize--;
29                 }
30                 return par1ItemStack;
31         }
32
33
34 }