import java.util.Iterator;
import java.util.Random;
-import pcc.chemicraft.debug.DebugData;
-import pcc.chemicraft.debug.DebugTick;
-import pcc.chemicraft.inventory.InventoryPyrolysisTableFuel;
-import pcc.chemicraft.inventory.InventoryPyrolysisTableMaterial;
-import pcc.chemicraft.inventory.InventoryPyrolysisTableResult;
-import pcc.chemicraft.system.PacketHandler;
-
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
+import pcc.chemicraft.debug.DebugData;
+import pcc.chemicraft.debug.DebugTick;
+import pcc.chemicraft.inventory.InventoryPyrolysisTableFuel;
+import pcc.chemicraft.inventory.InventoryPyrolysisTableMaterial;
+import pcc.chemicraft.inventory.InventoryPyrolysisTableResult;
+import pcc.chemicraft.system.PacketHandler;
import com.google.common.io.ByteArrayDataInput;
-import cpw.mods.fml.common.network.PacketDispatcher;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
public class TileEntityPyrolysisTable extends TileEntity {
private InventoryPyrolysisTableMaterial invm = new InventoryPyrolysisTableMaterial();
@Override
public void updateEntity() {
- //boolean var2 = false;
+ // boolean var2 = false;
boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
if (this.worldObj.getBlockId(xCoord, yCoord-1, zCoord) == Block.fire.blockID) {
} else if (this.worldObj.isThundering() && var1) {
this.heat += 0.25F;
} else {
- this.heat += 3F;
+ this.heat += 0.5F;
}
} else {
this.heat = 1700;
//var2 = true;
if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
this.inItem(itemstackMaterial);
- if (materialItem.stackSize >= 1) {
+ if (materialItem.stackSize > 1) {
this.invm.setInventorySlotContents(0, new ItemStack(materialItem.itemID, --materialItem.stackSize, materialItem.getItemDamage()));
} else {
this.invm.setInventorySlotContents(0, null);
if (fuelItem != null) {
if (itemstackFuel.itemID == fuelItem.itemID && itemstackFuel.getItemDamage() == fuelItem.getItemDamage()) {
this.fuelRestTime = fuelList.get(itemstackFuel);
- if (fuelItem.stackSize >= 1) {
+ if (fuelItem.stackSize > 1) {
this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
break;
} else {
new DebugData("BurnTime", this.burnTime),
new DebugData("アイテムが入るか", var2)
);
- */
+ */
}
@Override
public boolean isInItemCheck(ItemStack key) {
ItemStack[] results = recipeList.get(key).clone();
ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
- for (int i = 0; i < this.invr.getSizeInventory(); i++) {
- containerResults[i] = this.invr.getStackInSlot(i);
+ for (int j = 0; j < this.invr.getSizeInventory(); j++) {
+ containerResults[j] = this.invr.getStackInSlot(j);
}
for (int i = 0; i < results.length; i++) {
int var5 = results[i].stackSize;
for (int j = 0; j < containerResults.length; j++) {
if (containerResults[j] == null) {
+ containerResults[j] = results[i];
results[i] = null;
break;
} else {
int var7 = containerResults[j].getMaxStackSize();
if (var1 == var2 && var3 == var4) {
if (var5 + var6 <= var7) {
+ containerResults[j] = results[i];
results[i] = null;
break;
} else {
public void inItem(ItemStack key) {
ItemStack[] results = recipeList.get(key);
- ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
- for (int i = 0; i < this.invr.getSizeInventory(); i++) {
- containerResults[i] = this.invr.getStackInSlot(i);
- }
for (int i = 0; i < results.length; i++) {
+ ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
+ for (int j = 0; j < this.invr.getSizeInventory(); j++) {
+ containerResults[j] = this.invr.getStackInSlot(j);
+ }
int var1 = results[i].itemID;
int var3 = results[i].getItemDamage();
int var5 = results[i].stackSize;
int var7 = containerResults[j].getMaxStackSize();
if (var1 == var2 && var3 == var4) {
if (var5 + var6 <= var7) {
- System.out.println(var5);
- System.out.println(var6);
- System.out.println(var5 + var6);
- System.out.println(i);
- System.out.println(j);
this.invr.setInventorySlotContents(j, new ItemStack(results[i].itemID, var5 + var6, results[i].getItemDamage()));
break;
} else {
recipeList.put(material, result);
}
+ public float getFuelRestTime() {
+ return fuelRestTime;
+ }
+
}