OSDN Git Service

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