OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / tileentity / TileEntityElectrolysisTable.java
index 70a78ce..41a6dc5 100644 (file)
@@ -74,33 +74,6 @@ public class TileEntityElectrolysisTable extends TileEntity
        @Override
        public void updateEntity()
        {
-               boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
-               if (this.worldObj.getBlockId(xCoord, yCoord-1, zCoord) == Block.fire.blockID) {
-                       if (this.heat < 1700) {
-                               if (this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
-                                       this.heat += 0.1F;
-                               } else if (this.worldObj.isThundering() && var1) {
-                                       this.heat += 0.25F;
-                               } else {
-                                       this.heat += 0.5F;
-                               }
-                       } else {
-                               this.heat = 1700;
-                       }
-               } else {
-                       if (this.heat > 0) {
-                               if(this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
-                                       this.heat -= 0.25F;
-                               } else if(this.worldObj.isThundering() && var1) {
-                                       this.heat -= 0.5F;
-                               } else {
-                                       this.heat -= 0.05F;
-                               }
-                       } else {
-                               this.heat = 0;
-                       }
-               }
-
                if (this.fuelRestTime >= 0) {
                        this.burnTime += 10 * CENTER_HEAT / this.heat;
                        this.fuelRestTime -= 10 * CENTER_HEAT / this.heat;
@@ -113,7 +86,6 @@ public class TileEntityElectrolysisTable extends TileEntity
                                ItemStack materialItem = this.invm.getStackInSlot(0);
                                if (materialItem != null) {
                                        if (this.isInItemCheck(itemstackMaterial)) {
-                                               //var2 = true;
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
                                                        this.inItem(itemstackMaterial);
                                                        if (materialItem.stackSize > 1) {
@@ -129,7 +101,7 @@ public class TileEntityElectrolysisTable extends TileEntity
                        this.burnTime = 0;
                }
 
-               boolean var3 = false;
+               boolean var1 = false;
                if (this.heat > MIN_HEAT) {
                        Iterator<ItemStack> itMaterial = recipeList.keySet().iterator();
                        while (itMaterial.hasNext()) {
@@ -137,17 +109,16 @@ public class TileEntityElectrolysisTable extends TileEntity
                                ItemStack materialItem = this.invm.getStackInSlot(0);
                                if (materialItem != null) {
                                        if (this.isInItemCheck(itemstackMaterial)) {
-                                               //var2 = true;
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
-                                                       var3 = true;
+                                                       var1 = true;
                                                        if (this.fuelRestTime <= 0) {
-                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getChemicalCellsFuelList().keySet().iterator();
+                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getChemicalCellsList().keySet().iterator();
                                                                while (itFuel.hasNext()) {
                                                                        ItemStack itemstackFuel = itFuel.next();
                                                                        ItemStack fuelItem = this.invf.getStackInSlot(0);
                                                                        if (fuelItem != null) {
                                                                                if (itemstackFuel.itemID == fuelItem.itemID && itemstackFuel.getItemDamage() == fuelItem.getItemDamage()) {
-                                                                                       this.fuelRestTime = ChemiCraftAPI.instance().getChemicalCellsFuelList().get(itemstackFuel);
+                                                                                       this.fuelRestTime = ChemiCraftAPI.instance().getChemicalCellsList().get(itemstackFuel);
                                                                                        if (fuelItem.stackSize > 1) {
                                                                                                this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
                                                                                                break;
@@ -163,10 +134,9 @@ public class TileEntityElectrolysisTable extends TileEntity
                                        }
                                } else {
                                        this.burnTime = 0;
-                                       //var2 = false;
                                }
                        }
-                       if (!var3) {
+                       if (!var1) {
                                this.burnTime = 0;
                        }
                }
@@ -472,4 +442,8 @@ public class TileEntityElectrolysisTable extends TileEntity
                }
        }
 
+       public static void addRecipe(ItemStack material, ItemStack[] result) {
+               recipeList.put(material, result);
+       }
+
 }