OSDN Git Service

(・∀・)
[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.client.renderer.texture.IconRegister;
6 import net.minecraft.entity.monster.EntityMob;
7 import net.minecraft.entity.player.EntityPlayer;
8 import net.minecraft.item.Item;
9 import net.minecraft.item.ItemStack;
10 import net.minecraft.world.World;
11 import pcc.chemicraft.ChemiCraft;
12 import pcc.chemicraft.base.entity.EntityBlackSmoke;
13 import pcc.chemicraft.core.ChemiCraftCore;
14
15 /**
16  * なんか黒い煙のアイテムです。
17  * @author ponkotate
18  */
19 public class ItemBlackSmoke extends Item {
20
21         public HashMap<EntityMob, Integer> invisibilityMobsMap = new HashMap<EntityMob, Integer>();
22
23         public ItemBlackSmoke(int par1) {
24                 super(par1);
25                 this.setCreativeTab(ChemiCraftCore.creativeTabChemiCraft);
26         }
27
28         @Override
29         public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
30                 double var11 = par4 + 0.5D;
31                 double var12 = par5;
32                 double var13 = par6 + 0.5D;
33                 switch(par7) {
34                         case 0:
35                                 var12--;
36                                 break;
37                         case 1:
38                                 var12++;
39                                 break;
40                         case 2:
41                                 var13--;
42                                 break;
43                         case 3:
44                                 var13++;
45                                 break;
46                         case 4:
47                                 var11--;
48                                 break;
49                         case 5:
50                                 var11++;
51                                 break;
52                 }
53                 par3World.spawnEntityInWorld(new EntityBlackSmoke(par2EntityPlayer, par3World, var11, var12, var13));
54                 return true;
55         }
56
57         @Override
58         public void updateIcons(IconRegister par1IconRegister){
59                 this.iconIndex = par1IconRegister.registerIcon(ChemiCraft.TEXTURE + "ItemBlackSmoke");
60         }
61
62 }