OSDN Git Service

あーうあーう
authormozipi <mozipi@users.sourceforge.jp>
Sat, 29 Dec 2012 04:40:15 +0000 (13:40 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Sat, 29 Dec 2012 04:40:15 +0000 (13:40 +0900)
common/chemicraft/ChemiCraft.java
common/chemicraft/debug/SetBlockSupport.java [new file with mode: 0644]
common/chemicraft/item/ItemGasCollectingBottle.java
common/chemicraft/system/ChemiCraftCraftingManager.java
common/chemicraft/util/MaterialRecipe.java
common/chemicraft/util/MathHelperPlus.java

index 8a54a1c..0384d3f 100644 (file)
@@ -284,6 +284,9 @@ public class ChemiCraft {
                        new Character('A'), new ItemStack(this.itemAtoms, 1, 0),\r
                });\r
 \r
+               //\r
+               ChemiCraftAPI.instance.addDecompositionRecipe(new ItemStack(Block.dirt), new ItemStack[]{new ItemStack(Block.stone)});\r
+\r
                // 化合物を追加します\r
                ChemiCraftAPI.instance.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
 \r
diff --git a/common/chemicraft/debug/SetBlockSupport.java b/common/chemicraft/debug/SetBlockSupport.java
new file mode 100644 (file)
index 0000000..92df462
--- /dev/null
@@ -0,0 +1,581 @@
+package chemicraft.debug;\r
+import java.util.Random;\r
+\r
+import net.minecraft.src.World;\r
+\r
+public class SetBlockSupport\r
+{\r
+\r
+       static Random rand = new Random();\r
+\r
+       /**\r
+        * X方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param Length 長さ\r
+        * @param Direction 方向(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object lineX(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)\r
+       {\r
+               int loop2=0;\r
+               Object DataBox=null;\r
+               for(loop2=0;loop2 < Length;loop2++)\r
+               {\r
+                       switch(Direction)\r
+                       {\r
+                       case -1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z, Block, meta);\r
+                       case 0:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X-(Length-1)+loop2,Y,Z,Block,meta);\r
+                       case 1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X+loop2, Y, Z, Block,meta);\r
+                       }\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Y方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param Length 長さ\r
+        * @param Direction 方向(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object lineY(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)\r
+       {\r
+               int loop2=0;\r
+               Object DataBox=null;\r
+               for(loop2=0;loop2 < Length;loop2++)\r
+               {\r
+                       switch(Direction)\r
+                       {\r
+                       case -1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y-loop2, Z, Block,meta);\r
+                       case 0:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X,Y-(Length-1)+loop2,Z,Block,meta);\r
+                       case 1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y+loop2, Z, Block,meta);\r
+                       }\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Z方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param Length 長さ\r
+        * @param Direction 方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object lineZ(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)\r
+       {\r
+               int loop2=0;\r
+               Object DataBox=null;\r
+               for(loop2=0;loop2 < Length;loop2++)\r
+               {\r
+                       switch(Direction)\r
+                       {\r
+                       case -1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z-loop2, Block,meta);\r
+                       case 0:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X,Y,Z-(Length-1)+loop2,Block,meta);\r
+                       case 1:\r
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z+loop2, Block,meta);\r
+                       }\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * XY方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param XLength X方向の長さ\r
+        * @param YLength Y方向の長さ\r
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object  lineXY(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int YLength,int XDirection,int YDirection)\r
+       {\r
+               Object DataBox=null;\r
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);\r
+               DataBox = lineY(par1World,X,Y,Z,Block,YLength,meta,YDirection);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * XZ方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param XLength X方向の長さ\r
+        * @param ZLength Y方向の長さ\r
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object  lineXZ(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int ZLength,int XDirection,int ZDirection)\r
+       {\r
+               Object DataBox=null;\r
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);\r
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * YZ方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param YLength X方向の長さ\r
+        * @param ZLength Y方向の長さ\r
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object  lineYZ(World par1World,int X,int Y,int Z,int Block,int meta,int YLength,int ZLength,int YDirection,int ZDirection)\r
+       {\r
+               Object DataBox=null;\r
+               DataBox = lineY(par1World,X,Y,Z,Block,meta,YLength,YDirection);\r
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * XYZ方向に線状にBlockを配置します。\r
+        * Directionが0の場合、特殊な計算式で\r
+        * +,-方向:loop-1の長さになります。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param XLength X方向の長さ\r
+        * @param YLength Y方向の長さ\r
+        * @param ZLength Z方向の長さ\r
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)\r
+        * @return Object\r
+        */\r
+       public static Object  lineXYZ(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int YLength,int ZLength,int XDirection,int YDirection,int ZDirection)\r
+       {\r
+               Object DataBox=null;\r
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);\r
+               DataBox = lineY(par1World,X,Y,Z,Block,meta,YLength,YDirection);\r
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * X方向の壁を作成します。\r
+        * Directionは1で固定です。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param Length 幅\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object wallX(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int height)\r
+       {\r
+               Object DataBox = null;\r
+               for(int loop = 0;loop < Length;loop++){\r
+                       lineY(par1World, X - (Length/2) + loop, Y, Z, Block,meta, height, 1);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Z方向の壁を作成します。\r
+        * Directionは1で固定です。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param Length 幅\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object wallZ(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int height)\r
+       {\r
+               Object DataBox = null;\r
+               for(int loop = 0;loop < Length;loop++){\r
+                       lineY(par1World, X, Y, Z - (Length/2) + loop, Block,meta, height, 1);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * 辺だけの四角を作成します。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param LengthX X方向の長さ\r
+        * @param LengthZ  Z方向の長さ\r
+        * @return Object\r
+        */\r
+       public static Object spuareFrame(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ)\r
+       {\r
+               Object DataBox = null;\r
+               DataBox = lineX(par1World, X, Y, Z + (LengthZ/2), Block,meta, LengthX/2+1, 0);\r
+               DataBox = lineX(par1World, X, Y, Z - (LengthZ/2), Block,meta, LengthX/2+1, 0);\r
+               DataBox = lineZ(par1World, X + (LengthX/2), Y, Z, Block,meta, LengthZ/2+1, 0);\r
+               DataBox = lineZ(par1World, X - (LengthX/2), Y, Z, Block,meta, LengthZ/2+1, 0);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * 辺だけの箱を作成します。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param LengthX X方向の長さ\r
+        * @param LengthZ  Z方向の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object boxFrame(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)\r
+       {\r
+               Object DataBox=null;\r
+               DataBox = lineX(par1World, X, Y, Z + (LengthZ/2), Block,meta, LengthX/2, 0);\r
+               DataBox = lineX(par1World, X, Y, Z - (LengthZ/2), Block,meta, LengthX/2, 0);\r
+               DataBox = lineX(par1World, X, Y + height-1, Z + (LengthZ/2), Block,meta, LengthX/2, 0);\r
+               DataBox = lineX(par1World, X, Y + height-1, Z - (LengthZ/2), Block,meta, LengthX/2, 0);\r
+\r
+               DataBox = lineY(par1World,X +(LengthX/2),Y,Z +(LengthZ/2),Block,meta,height,1);\r
+               DataBox = lineY(par1World,X -(LengthX/2),Y,Z +(LengthZ/2),Block,meta,height,1);\r
+               DataBox = lineY(par1World,X +(LengthX/2),Y,Z - (LengthZ/2),Block,meta,height,1);\r
+               DataBox = lineY(par1World,X -(LengthX/2),Y,Z - (LengthZ/2),Block,meta,height,1);\r
+\r
+               DataBox = lineZ(par1World, X + (LengthX/2), Y, Z, Block,meta, LengthZ/2, 0);\r
+               DataBox = lineZ(par1World, X - (LengthX/2), Y, Z, Block,meta, LengthZ/2, 0);\r
+               DataBox = lineZ(par1World, X + (LengthX/2), Y + height-1, Z, Block,meta, LengthZ/2, 0);\r
+               DataBox = lineZ(par1World, X - (LengthX/2), Y + height-1, Z, Block,meta, LengthZ/2, 0);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * 四角を作成します。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param LengthX X方向の長さ\r
+        * @param LengthZ  Z方向の長さ\r
+        * @return Object\r
+        */\r
+       public static Object square(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ)\r
+       {\r
+               Object DataBox = null;\r
+               int loop1 = 0;\r
+               for(loop1=0; loop1 < LengthZ; loop1++){\r
+                       DataBox = lineX(par1World,X - (LengthX/2),Y,Z - (LengthZ/2) + loop1,Block,meta,LengthX,1);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * 箱を生成します。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param LengthX X方向の長さ\r
+        * @param LengthZ  Z方向の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object box(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)\r
+       {\r
+               Object DataBox = null;\r
+               DataBox = square(par1World, X, Y, Z, Block, meta,LengthX,LengthZ);\r
+               DataBox = square(par1World,X,Y+height,Z,Block,meta,LengthX,LengthZ);\r
+               DataBox = wallX(par1World,X,Y,Z-(LengthZ/2),Block,meta,LengthX,height);\r
+               DataBox = wallZ(par1World,X-(LengthX/2),Y,Z,Block,meta,LengthZ,height);\r
+               DataBox = wallX(par1World,X,Y,Z+(LengthZ/2),Block,meta,LengthX,height);\r
+               DataBox = wallZ(par1World,X+(LengthX/2),Y,Z,Block,meta,LengthZ,height);\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Blockで埋め尽くされた箱を生成します。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param LengthX X方向の長さ\r
+        * @param LengthZ  Z方向の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object fillBox(World par1World , int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)\r
+       {\r
+               Object DataBox = null;\r
+               DataBox = square(par1World, X, Y, Z, Block,meta, LengthX,LengthZ);\r
+               DataBox = square(par1World,X,Y+height,Z,Block,meta,LengthX,LengthZ);\r
+               DataBox = wallX(par1World,X,Y,Z-(LengthZ/2),Block,meta,LengthX,height);\r
+               DataBox = wallZ(par1World,X-(LengthX/2),Y,Z,Block,meta,LengthZ,height);\r
+               DataBox = wallX(par1World,X,Y,Z+(LengthZ/2),Block,meta,LengthX,height);\r
+               DataBox = wallZ(par1World,X+(LengthX/2),Y,Z,Block,meta,LengthZ,height);\r
+\r
+               for(int i = 0; i < LengthX - 1; i++)\r
+               {\r
+                       DataBox = wallZ(par1World,X + 1 - LengthX / 2 + i, Y , Z , Block ,meta,LengthZ, height);\r
+               }\r
+\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * 座標ごとにデータを指定して配置します。\r
+        * 配列になっているので、順番に指定してください。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param XPosition 配置する相対X座標\r
+        * @param YPosition 配置する相対Y座標\r
+        * @param ZPosition 配置する相対Z座標\r
+        * @param Option\r
+        * @return Object\r
+        */\r
+       public static Object fineSetBlock(World par1World,int X,int Y,int Z,int[] Block,int[] meta,int[] XPosition,int[] YPosition,int[] ZPosition,Object[] Option){\r
+               Object DataBox = null;\r
+               for(int i=0;i<Block.length;i++){\r
+                       DataBox = par1World.setBlockAndMetadata(X+XPosition[i], Y+YPosition[i], Z+ZPosition[i], Block[i],meta[i]);\r
+               }\r
+\r
+               if(Option!=null){\r
+                       for(int j=0;j<Option.length;j++){\r
+                               DataBox = Option[j];\r
+                       }\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * X方向に台形を作成します。\r
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param upperSide 上辺の長さ\r
+        * @param bottomSide 下辺の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object TrapezoidX(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){\r
+               Object DataBox = null;\r
+               int Rate=0;\r
+               int Math=0;\r
+               int XRate=0;\r
+               int YRate = 0;\r
+               for(int i=0;i<height;i++){\r
+                       YRate++;\r
+                       Math++;\r
+                       XRate++;\r
+                       if(upperSide < bottomSide){\r
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){\r
+                                       Rate++;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       if(bottomSide < upperSide){\r
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){\r
+                                       Rate--;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       DataBox=lineZ(par1World, X+XRate-1, Y+YRate, Z, Block, meta, upperSide+Rate, 0);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Y方向のXラインに台形を作成します。\r
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param upperSide 上辺の長さ\r
+        * @param bottomSide 下辺の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object TrapezoidY_X(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){\r
+               Object DataBox = null;\r
+               int Rate=0;\r
+               int Math=0;\r
+               int YRate = 0;\r
+               for(int i=0;i<height;i++){\r
+                       YRate++;\r
+                       Math++;\r
+                       if(upperSide < bottomSide){\r
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){\r
+                                       Rate++;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       if(bottomSide < upperSide){\r
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){\r
+                                       Rate--;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       DataBox=lineZ(par1World, X, Y+YRate, Z, Block, meta, upperSide+Rate, 0);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Y方向のZラインに台形を作成します。\r
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param upperSide 上辺の長さ\r
+        * @param bottomSide 下辺の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object TrapezoidY_Z(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){\r
+               Object DataBox = null;\r
+               int Rate=0;\r
+               int Math=0;\r
+               int YRate = 0;\r
+               for(int i=0;i<height;i++){\r
+                       YRate++;\r
+                       Math++;\r
+                       if(upperSide < bottomSide){\r
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){\r
+                                       Rate++;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       if(bottomSide < upperSide){\r
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){\r
+                                       Rate--;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       DataBox=lineX(par1World, X, Y+YRate, Z, Block, meta, upperSide+Rate, 0);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+       /**\r
+        * Z方向に台形を作成します。\r
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。\r
+        * @param par1World\r
+        * @param X 基準X座標\r
+        * @param Y 基準Y座標\r
+        * @param Z 基準Z座標\r
+        * @param Block 配置するBlock\r
+        * @param meta 配置するMetadata\r
+        * @param upperSide 上辺の長さ\r
+        * @param bottomSide 下辺の長さ\r
+        * @param height 高さ\r
+        * @return Object\r
+        */\r
+       public static Object TrapezoidZ(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){\r
+               Object DataBox = null;\r
+               int Rate=0;\r
+               int Math=0;\r
+               int ZRate=0;\r
+               for(int i=0;i<height;i++){\r
+                       Math++;\r
+                       ZRate++;\r
+                       if(upperSide < bottomSide){\r
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){\r
+                                       Rate++;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       if(bottomSide < upperSide){\r
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){\r
+                                       Rate--;\r
+                                       Math=0;\r
+                               }\r
+                       }\r
+\r
+                       DataBox=lineX(par1World, X, Y, Z+ZRate, Block, meta, upperSide+Rate, 0);\r
+               }\r
+               return DataBox;\r
+       }\r
+\r
+}
\ No newline at end of file
index d4a47f2..83119a8 100644 (file)
@@ -25,9 +25,9 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
 
                int heightValue = par2World.getHeightValue((int) par3EntityPlayer.posX, (int) par3EntityPlayer.posZ);
 
-               int result1 = MathHelperPlus.instance.Probability(99, 1);
-               int result2 = MathHelperPlus.instance.Probability(78, 21, 1);
-               int result3 = MathHelperPlus.instance.Probability(0.032, 0.0018, 0.000012, 0.00052);
+               int result1 = MathHelperPlus.probability(99, 1);
+               int result2 = MathHelperPlus.probability(78, 21, 1);
+               int result3 = MathHelperPlus.probability(0.032, 0.0018, 0.000012, 0.00052);
                if (this.atomInfo.isOverY(heightValue)) {
                        if (result1 == 0) {
                                if (result2 == 0) {
index d8cf124..6945d93 100644 (file)
@@ -23,6 +23,8 @@ public class ChemiCraftCraftingManager {
 
                //Just loop of amount of added recipe.
                for(int i1 = 0;i1 < ChemiCraftAPI.instance.getDecompositionMaterial().size();i1++){
+                       //Check of null of the Material Slot.
+                       if(par1IInventory.getStackInSlot(16) == null){ this.clearResults(par1IInventory, 16); return new ItemStack[16];}
                        //Recipe the match?
                        boolean match = true;
                        //Reset the results.
@@ -34,8 +36,6 @@ public class ChemiCraftCraftingManager {
                        int recipeID = ChemiCraftAPI.instance.getDecompositionMaterial().get(i1).itemID;
                        int recipeDamage = ChemiCraftAPI.instance.getDecompositionMaterial().get(i1).getItemDamage();
 
-                       //Check of null of the Material Slot.
-                       if(par1IInventory.getStackInSlot(16) == null){ this.clearResults(par1IInventory, 16); return new ItemStack[16];}
                        //ID check.
                        if(materialID != recipeID){ match = false;}
                        //Damage check.
index 1e7f2c5..276f92d 100644 (file)
@@ -34,6 +34,7 @@ public class MaterialRecipe {
                invItems = (ItemStack[]) ChemiCraft.instance.arrayAuxiliary.deleteNull(invItems);
 
                if(isSharpless){
+                       Arrays.sort(invItems, new ComparaterItemStackID());
 
                }else{
 
index b9b8fd6..96cff62 100644 (file)
@@ -6,30 +6,19 @@ import java.util.Random;
 public class MathHelperPlus
 {
 
-       public static MathHelperPlus instance = new MathHelperPlus();
-
-       /** 
+       /**
         * Return probability(0~).
         */
-       public static int Probability(double... par1)
+       public static int probability(double... par1)
        {
                ArrayList<Double> var1 = new ArrayList<Double>();
                for (int var2 = 0; var2 < par1.length; var2++){
                        var1.add(par1[var2]);
                }
-               return Probability(var1);
-       }
-
-       public static int Probability(int... par1)
-       {
-               ArrayList<Double> var1 = new ArrayList<Double>();
-               for (int var2 = 0; var2 < par1.length; var2++){
-                       var1.add((double)par1[var2]);
-               }
-               return Probability(var1);
+               return probability(var1);
        }
 
-       public static int Probability(ArrayList<Double> par1)
+       public static int probability(ArrayList<Double> par1)
        {
                Random var2 = new Random();
                int var3 = var2.nextInt(100);