OSDN Git Service

素材製作台(減算処理・NBT処理抜き)を製作
[chemicraft/chemicraft.git] / common / chemicraft / item / ItemAtomGrenade.java
index cc94898..4ea937d 100644 (file)
@@ -25,22 +25,23 @@ public class ItemAtomGrenade extends Item {
                boolean var2 = false;
                boolean var3 = false;
 
-               NBTTagList var4 = par1ItemStack.getTagCompound().getTagList("Effect");
+               if(par1ItemStack.stackTagCompound != null){
+                       NBTTagList var4 = par1ItemStack.getTagCompound().getTagList("Effect");
 
-               for(int i = 0;i < 3;i++){
-                       if(!((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("")){
-                               if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Hydrogen")){
-                                       var1 = true;
-                               }
-                               if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Carbon")){
-                                       var2 = true;
-                               }
-                               if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Uranium")){
-                                       var3 = true;
+                       for(int i = 0;i < 3;i++){
+                               if(!((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("")){
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Hydrogen")){
+                                               var1 = true;
+                                       }
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Carbon")){
+                                               var2 = true;
+                                       }
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Uranium")){
+                                               var3 = true;
+                                       }
                                }
                        }
                }
-
                EntityAtomGrenade entity = new EntityAtomGrenade(par2World, par3EntityPlayer, var1, var2, var3);
                par2World.spawnEntityInWorld(entity);
                par1ItemStack.stackSize--;