diff --git a/src/main/java/techreborn/api/recipe/RecipeCrafter.java b/src/main/java/techreborn/api/recipe/RecipeCrafter.java index 6be490f7e..218801498 100644 --- a/src/main/java/techreborn/api/recipe/RecipeCrafter.java +++ b/src/main/java/techreborn/api/recipe/RecipeCrafter.java @@ -231,7 +231,6 @@ public class RecipeCrafter { currentTickTime = data.getInteger("currentTickTime"); isactive = data.getBoolean("isActive"); - System.out.println(isactive); } public void writeToNBT(NBTTagCompound tag) { diff --git a/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java b/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java index 6cf57470f..b23eda788 100644 --- a/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java +++ b/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java @@ -5,7 +5,7 @@ import net.minecraft.inventory.Slot; import techreborn.client.SlotOutput; import techreborn.tiles.TileAssemblingMachine; -public class ContainerAssemblingMachine extends TechRebornContainer { +public class ContainerAssemblingMachine extends ContainerCrafting { EntityPlayer player; @@ -22,6 +22,7 @@ public class ContainerAssemblingMachine extends TechRebornContainer { public ContainerAssemblingMachine(TileAssemblingMachine tileAssemblingMachine, EntityPlayer player) { + super(tileAssemblingMachine.crafter); tile = tileAssemblingMachine; this.player = player; diff --git a/src/main/java/techreborn/client/container/ContainerChemicalReactor.java b/src/main/java/techreborn/client/container/ContainerChemicalReactor.java index c51619a5a..88ea3a565 100644 --- a/src/main/java/techreborn/client/container/ContainerChemicalReactor.java +++ b/src/main/java/techreborn/client/container/ContainerChemicalReactor.java @@ -5,7 +5,7 @@ import net.minecraft.inventory.Slot; import techreborn.client.SlotOutput; import techreborn.tiles.TileChemicalReactor; -public class ContainerChemicalReactor extends TechRebornContainer { +public class ContainerChemicalReactor extends ContainerCrafting { EntityPlayer player; @@ -22,6 +22,7 @@ public class ContainerChemicalReactor extends TechRebornContainer { public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) { + super(tilechemicalReactor.crafter); tile = tilechemicalReactor; this.player = player; diff --git a/src/main/java/techreborn/client/container/ContainerLathe.java b/src/main/java/techreborn/client/container/ContainerLathe.java index adbdebd36..32b022c44 100644 --- a/src/main/java/techreborn/client/container/ContainerLathe.java +++ b/src/main/java/techreborn/client/container/ContainerLathe.java @@ -5,7 +5,7 @@ import net.minecraft.inventory.Slot; import techreborn.client.SlotOutput; import techreborn.tiles.TileLathe; -public class ContainerLathe extends TechRebornContainer { +public class ContainerLathe extends ContainerCrafting { EntityPlayer player; @@ -22,6 +22,7 @@ public class ContainerLathe extends TechRebornContainer { public ContainerLathe(TileLathe tilelathe, EntityPlayer player) { + super(tilelathe.crafter); tile = tilelathe; this.player = player; diff --git a/src/main/java/techreborn/client/container/ContainerPlateCuttingMachine.java b/src/main/java/techreborn/client/container/ContainerPlateCuttingMachine.java index c19502077..dfac75f19 100644 --- a/src/main/java/techreborn/client/container/ContainerPlateCuttingMachine.java +++ b/src/main/java/techreborn/client/container/ContainerPlateCuttingMachine.java @@ -5,7 +5,7 @@ import net.minecraft.inventory.Slot; import techreborn.client.SlotOutput; import techreborn.tiles.TilePlateCuttingMachine; -public class ContainerPlateCuttingMachine extends TechRebornContainer { +public class ContainerPlateCuttingMachine extends ContainerCrafting { EntityPlayer player; @@ -22,6 +22,7 @@ public class ContainerPlateCuttingMachine extends TechRebornContainer { public ContainerPlateCuttingMachine(TilePlateCuttingMachine tileplatecuttingmachine, EntityPlayer player) { + super(tileplatecuttingmachine.crafter); platecuttingmachine = tileplatecuttingmachine; this.player = player; diff --git a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java index 6be95b335..65bd9d716 100644 --- a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java @@ -14,9 +14,11 @@ public class GuiAssemblingMachine extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/assembling_machine.png"); TileAssemblingMachine assemblingmachine; + ContainerAssemblingMachine containerAssemblingMachine; public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) { super(new ContainerAssemblingMachine(tileassemblinmachine, player)); + containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots; this.xSize = 176; this.ySize = 167; assemblingmachine = tileassemblinmachine; @@ -40,12 +42,12 @@ public class GuiAssemblingMachine extends GuiContainer { int j = 0; - if(assemblingmachine.crafter.currentRecipe != null) { - j = this.assemblingmachine.crafter.currentTickTime * 20 / this.assemblingmachine.crafter.currentRecipe.tickTime(); - } + if(this.containerAssemblingMachine.currentTickTime != 0){ + j = this.containerAssemblingMachine.currentTickTime * 20 / this.containerAssemblingMachine.currentNeededTicks; + } this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16); - j = (int)this.assemblingmachine.energy.getEnergyStored() * 12 / this.assemblingmachine.energy.getCapacity(); + j = this.containerAssemblingMachine.energy * 12 / this.assemblingmachine.energy.getCapacity(); if(j > 0) { this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); } diff --git a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java index 447e4f995..7aecf2349 100644 --- a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java +++ b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java @@ -14,9 +14,11 @@ public class GuiChemicalReactor extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chemical_reactor.png"); TileChemicalReactor chemicalReactor; + ContainerChemicalReactor containerChemicalReactor; public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) { super(new ContainerChemicalReactor(tilechemicalReactor, player)); + containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots; this.xSize = 176; this.ySize = 167; chemicalReactor = tilechemicalReactor; @@ -40,12 +42,12 @@ public class GuiChemicalReactor extends GuiContainer { int j = 0; - if(chemicalReactor.crafter.currentRecipe != null) { - j = this.chemicalReactor.crafter.currentTickTime * 11 / this.chemicalReactor.crafter.currentRecipe.tickTime(); - } + if(this.containerChemicalReactor.currentTickTime != 0){ + j = this.containerChemicalReactor.currentTickTime * 20 / this.containerChemicalReactor.currentNeededTicks; + } this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j); - j = (int)this.chemicalReactor.energy.getEnergyStored() * 12 / this.chemicalReactor.energy.getCapacity(); + j = this.containerChemicalReactor.energy * 12 / this.chemicalReactor.energy.getCapacity(); if(j > 0) { this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); } diff --git a/src/main/java/techreborn/client/gui/GuiLathe.java b/src/main/java/techreborn/client/gui/GuiLathe.java index 0ac61d3a4..a62d73bd3 100644 --- a/src/main/java/techreborn/client/gui/GuiLathe.java +++ b/src/main/java/techreborn/client/gui/GuiLathe.java @@ -14,9 +14,11 @@ public class GuiLathe extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/lathe.png"); TileLathe lathe; + ContainerLathe containerLathe; public GuiLathe(EntityPlayer player, TileLathe tilelathe) { super(new ContainerLathe(tilelathe, player)); + containerLathe = (ContainerLathe) this.inventorySlots; this.xSize = 176; this.ySize = 167; lathe = tilelathe; @@ -40,12 +42,12 @@ public class GuiLathe extends GuiContainer { int j = 0; - if(lathe.crafter.currentRecipe != null) { - j = this.lathe.crafter.currentTickTime * 20 / this.lathe.crafter.currentRecipe.tickTime(); - } + if(this.containerLathe.currentTickTime != 0){ + j = this.containerLathe.currentTickTime * 20 / this.containerLathe.currentNeededTicks; + } this.drawTexturedModalRect(k + 80, l + 34, 176, 14, j, 16); - j = (int)this.lathe.energy.getEnergyStored() * 12 / this.lathe.energy.getCapacity(); + j = this.containerLathe.energy * 12 / this.lathe.energy.getCapacity(); if(j > 0) { this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); } diff --git a/src/main/java/techreborn/client/gui/GuiPlateCuttingMachine.java b/src/main/java/techreborn/client/gui/GuiPlateCuttingMachine.java index bed97e486..2d43b2228 100644 --- a/src/main/java/techreborn/client/gui/GuiPlateCuttingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiPlateCuttingMachine.java @@ -15,8 +15,11 @@ public class GuiPlateCuttingMachine extends GuiContainer { TilePlateCuttingMachine platecuttingmachine; + ContainerPlateCuttingMachine containerPlateCuttingMachine; + public GuiPlateCuttingMachine(EntityPlayer player, TilePlateCuttingMachine tileplatecuttingmachine) { super(new ContainerPlateCuttingMachine(tileplatecuttingmachine, player)); + containerPlateCuttingMachine = (ContainerPlateCuttingMachine) this.inventorySlots; this.xSize = 176; this.ySize = 167; platecuttingmachine = tileplatecuttingmachine; @@ -40,12 +43,12 @@ public class GuiPlateCuttingMachine extends GuiContainer { int j = 0; - if(platecuttingmachine.crafter.currentRecipe != null) { - j = this.platecuttingmachine.crafter.currentTickTime * 20 / this.platecuttingmachine.crafter.currentRecipe.tickTime(); - } + if(this.containerPlateCuttingMachine.currentTickTime != 0){ + j = this.containerPlateCuttingMachine.currentTickTime * 20 / this.containerPlateCuttingMachine.currentNeededTicks; + } this.drawTexturedModalRect(k + 83, l + 34, 176, 14, j, 16); - j = (int)this.platecuttingmachine.energy.getEnergyStored() * 12 / this.platecuttingmachine.energy.getCapacity(); + j = this.containerPlateCuttingMachine.energy * 12 / this.platecuttingmachine.energy.getCapacity(); if(j > 0) { this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); }