OSDN Git Service

修正・変更
authorponkotate <ponkotate@users.sourceforge.jp>
Sun, 31 Mar 2013 02:42:38 +0000 (11:42 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sun, 31 Mar 2013 02:42:38 +0000 (11:42 +0900)
・バグ発見

common/pcc/chemicraft/base/ChemiCraftRegisterBaseRecipe.java
common/pcc/chemicraft/core/item/ItemAtoms.java
common/pcc/chemicraft/util/AtomInfo.java

index 87213d6..653365f 100644 (file)
@@ -1,5 +1,6 @@
 package pcc.chemicraft.base;
 
+import cpw.mods.fml.common.registry.GameRegistry;
 import net.minecraft.block.Block;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
@@ -54,7 +55,6 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                /*
                 * 素材制作代のレシピ
                 */
-
                //手榴弾の追加
                this.mod.api.addMaterialRecipe(new ItemStack[] {
                                null,
@@ -71,6 +71,13 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                new NBTRecipeGrenade()
                                );
 
+               this.mod.api.addSharplessMaterialRecipe(new ItemStack[] {
+                               new ItemStack(this.mod.itemAtomGrenade, 1, 0),
+               },
+               new ItemStack(this.mod.itemAtomGrenade, 1, 0),
+               new NBTRecipeGrenade()
+                               );
+
                /*
                 * 分解台のレシピ
                 */
index 4c41247..afc31d6 100644 (file)
@@ -3,10 +3,15 @@ package pcc.chemicraft.core.item;
 import java.util.List;
 
 import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
 import pcc.chemicraft.ChemiCraft;
 import pcc.chemicraft.core.ChemiCraftCore;
+import pcc.chemicraft.util.AtomInfo;
 import cpw.mods.fml.relauncher.Side;
 import cpw.mods.fml.relauncher.SideOnly;
 
@@ -22,6 +27,22 @@ public class ItemAtoms extends Item {
 
 
 
+       @Override
+       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
+       {
+               if (AtomInfo.isRI(par1ItemStack.getItemDamage())){
+                       if (par3Entity instanceof EntityLiving){
+                               EntityLiving entity = (EntityLiving)par3Entity;
+                               entity.addPotionEffect(new PotionEffect(2, 1, 1));
+                               entity.addPotionEffect(new PotionEffect(4, 1, 1));
+                               entity.addPotionEffect(new PotionEffect(18, 1, 1));
+                               entity.addPotionEffect(new PotionEffect(19, 1, 1));
+                       }
+               }
+       }
+
+
+
        @SuppressWarnings({ "unchecked", "rawtypes" })
        @SideOnly(Side.CLIENT)
        @Override
index 8db2250..f6ffacb 100644 (file)
@@ -18,7 +18,7 @@ public final class AtomInfo {
        /**
         * 気体
         */
-       public static final Integer[] gases = new Integer[]{
+       public static final Integer[] GASES = new Integer[]{
                1, 2, 7, 8, 9, 10, 17, 18, 36, 54, 86
        };
 
@@ -26,7 +26,7 @@ public final class AtomInfo {
        /**
         * 液体
         */
-       public static final Integer[] liquids = new Integer[]{
+       public static final Integer[] LIQUIDS = new Integer[]{
                35, 80
        };
 
@@ -34,26 +34,31 @@ public final class AtomInfo {
        /**
         * 不明
         */
-       public static final Integer[] unknown = new Integer[]{
+       public static final Integer[] UNKNOWN = new Integer[]{
                98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118
        };
 
 
-       public static final Integer[] lanthanoid = new Integer[]{
+       public static final Integer[] LANTHANOID = new Integer[]{
                57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
        };
 
 
-       public static final Integer[] actinoid = new Integer[]{
+       public static final Integer[] ACTINOID = new Integer[]{
                89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103
        };
 
 
-       public static final Integer[] unofficial = new Integer[]{
+       public static final Integer[] UNOFFICIAL = new Integer[]{
                113, 114, 115, 116, 117, 118
        };
 
 
+       public static final Integer[] RI = new Integer[]{
+               92
+       };
+
+
        /**
         * X, Y, Z座標
         */
@@ -114,7 +119,7 @@ public final class AtomInfo {
 
 
        public static boolean isGas(int par1){
-               for (int var2:gases){
+               for (int var2:GASES){
                        if (par1 == var2){
                                return true;
                        }
@@ -125,7 +130,7 @@ public final class AtomInfo {
 
 
        public static boolean isLiquid(int par1){
-               for (int var2:liquids){
+               for (int var2:LIQUIDS){
                        if (par1 == var2){
                                return true;
                        }
@@ -145,7 +150,7 @@ public final class AtomInfo {
 
 
        public static boolean isUnknown(int par1){
-               for (int var2:unknown){
+               for (int var2:UNKNOWN){
                        if (par1 == var2){
                                return true;
                        }
@@ -156,7 +161,7 @@ public final class AtomInfo {
 
 
        public static boolean isLanthanoid(int par1){
-               for (int var2:lanthanoid){
+               for (int var2:LANTHANOID){
                        if (par1 == var2){
                                return true;
                        }
@@ -167,7 +172,7 @@ public final class AtomInfo {
 
 
        public static boolean isActinoid(int par1){
-               for (int var2:actinoid){
+               for (int var2:ACTINOID){
                        if (par1 == var2){
                                return true;
                        }
@@ -178,7 +183,18 @@ public final class AtomInfo {
 
 
        public static boolean isUnofficial(int par1){
-               for (int var2:unofficial){
+               for (int var2:UNOFFICIAL){
+                       if (par1 == var2){
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+
+
+       public static boolean isRI(int par1){
+               for (int var2:RI){
                        if (par1 == var2){
                                return true;
                        }