OSDN Git Service

いろいろした
[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 /**
11  * 粉塵のアイテムです
12  * @author mozipi
13  */
14 public class ItemDust extends Item {
15
16         public ItemDust(int par1) {
17                 super(par1);
18                 this.setCreativeTab(ChemiCraftCore.instance.creativeTabChemiCraft);
19         }
20
21         @Override
22         public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
23                         EntityPlayer par3EntityPlayer) {
24
25
26                 if (!par2World.isRemote) {
27                         par2World.spawnEntityInWorld(new EntityDust(par2World,
28                                         par3EntityPlayer.posX,
29                                         par3EntityPlayer.posY,
30                                         par3EntityPlayer.posZ));
31                         par1ItemStack.stackSize--;
32                 }
33                 return par1ItemStack;
34         }
35
36
37 }