OSDN Git Service

f14c8299efc777055d319d4c84570b5c631e973e
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / item / ItemBlackSmoke.java
1 package pcc.chemicraft.base.item;
2
3 import java.util.HashMap;
4
5 import net.minecraft.entity.monster.EntityMob;
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 import pcc.chemicraft.ChemiCraft;
11 import pcc.chemicraft.base.entity.EntityBlackSmoke;
12 import pcc.chemicraft.core.ChemiCraftCore;
13
14
15 public class ItemBlackSmoke extends Item
16 {
17
18         public HashMap<EntityMob, Integer> invisibilityMobsMap = new HashMap<EntityMob, Integer>();
19
20         public ItemBlackSmoke(int par1)
21         {
22                 super(par1);
23                 this.setCreativeTab(ChemiCraftCore.creativeTabChemiCraft);
24         }
25
26         @Override
27         public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
28         {
29                 double var11 = par4 + 0.5D;
30                 double var12 = par5;
31                 double var13 = par6 + 0.5D;
32                 switch(par7){
33                         case 0:
34                                 var12--;
35                                 break;
36                         case 1:
37                                 var12++;
38                                 break;
39                         case 2:
40                                 var13--;
41                                 break;
42                         case 3:
43                                 var13++;
44                                 break;
45                         case 4:
46                                 var11--;
47                                 break;
48                         case 5:
49                                 var11++;
50                                 break;
51                 }
52                 par3World.spawnEntityInWorld(new EntityBlackSmoke(par2EntityPlayer, par3World, var11, var12, var13));
53                 return true;
54         }
55
56         @Override
57         public String getTextureFile(){
58                 return ChemiCraft.ITEM_TEXTURE;
59         }
60
61 }