Now sync to the client side tile, not the container.
This commit is contained in:
parent
17ed2d163d
commit
1e656b26e7
9 changed files with 25 additions and 20 deletions
|
@ -117,6 +117,7 @@ public class RecipeCrafter {
|
|||
for (int i = 0; i < recipe.getOutputs().size(); i++) {//This checks to see if it can fit all of the outputs
|
||||
if (!canFitStack(recipe.getOutputs().get(i), outputSlots[i])) {
|
||||
canGiveInvAll = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (canGiveInvAll) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.inventory.Slot;
|
|||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
|
||||
public class ContainerAlloySmelter extends TechRebornContainer {
|
||||
public class ContainerAlloySmelter extends ContainerCrafting {
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
|
@ -22,6 +22,7 @@ public class ContainerAlloySmelter extends TechRebornContainer {
|
|||
public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter,
|
||||
EntityPlayer player)
|
||||
{
|
||||
super(tileAlloysmelter.crafter);
|
||||
tile = tileAlloysmelter;
|
||||
this.player = player;
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ public abstract class ContainerCrafting extends TechRebornContainer {
|
|||
|
||||
RecipeCrafter crafter;
|
||||
|
||||
public int currentTickTime = 0;
|
||||
public int currentNeededTicks = 0;
|
||||
public int energy;
|
||||
int currentTickTime = 0;
|
||||
int currentNeededTicks = 0;
|
||||
int energy;
|
||||
|
||||
public ContainerCrafting(RecipeCrafter crafter) {
|
||||
this.crafter = crafter;
|
||||
|
@ -52,5 +52,8 @@ public abstract class ContainerCrafting extends TechRebornContainer {
|
|||
} else if(id == 2){
|
||||
this.energy = value;
|
||||
}
|
||||
this.crafter.currentTickTime = currentTickTime;
|
||||
this.crafter.currentNeededTicks = currentNeededTicks;
|
||||
this.crafter.energy.setEnergyStored(energy);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public class GuiAlloySmelter extends GuiContainer {
|
|||
|
||||
int j = 0;
|
||||
|
||||
if(alloysmelter.crafter.currentRecipe != null) {
|
||||
if(alloysmelter.crafter.currentTickTime != 0) {
|
||||
j = this.alloysmelter.crafter.currentTickTime * 24 / this.alloysmelter.crafter.currentNeededTicks;
|
||||
}
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
|
|
|
@ -42,12 +42,12 @@ public class GuiAssemblingMachine extends GuiContainer {
|
|||
|
||||
int j = 0;
|
||||
|
||||
if(this.containerAssemblingMachine.currentTickTime != 0){
|
||||
j = this.containerAssemblingMachine.currentTickTime * 20 / this.containerAssemblingMachine.currentNeededTicks;
|
||||
if(this.assemblingmachine.crafter.currentTickTime != 0){
|
||||
j = this.assemblingmachine.crafter.currentTickTime * 20 / this.assemblingmachine.crafter.currentNeededTicks;
|
||||
}
|
||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||
|
||||
j = this.containerAssemblingMachine.energy * 12 / this.assemblingmachine.energy.getCapacity();
|
||||
j = (int) (this.assemblingmachine.energy.getEnergyStored() * 12 / this.assemblingmachine.energy.getCapacity());
|
||||
if(j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ public class GuiChemicalReactor extends GuiContainer {
|
|||
|
||||
int j = 0;
|
||||
|
||||
if(this.containerChemicalReactor.currentTickTime != 0){
|
||||
j = this.containerChemicalReactor.currentTickTime * 20 / this.containerChemicalReactor.currentNeededTicks;
|
||||
if(this.chemicalReactor.crafter.currentTickTime != 0){
|
||||
j = this.chemicalReactor.crafter.currentTickTime * 20 / this.chemicalReactor.crafter.currentNeededTicks;
|
||||
}
|
||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
||||
|
||||
j = this.containerChemicalReactor.energy * 12 / this.chemicalReactor.energy.getCapacity();
|
||||
j = (int) (this.chemicalReactor.crafter.energy.getEnergyStored() * 12 / this.chemicalReactor.energy.getCapacity());
|
||||
if(j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
|
|
@ -42,13 +42,13 @@ public class GuiImplosionCompressor extends GuiContainer{
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
if(this.containerImplosionCompressor.currentTickTime != 0){
|
||||
j = this.containerImplosionCompressor.currentTickTime * 20 / this.containerImplosionCompressor.currentNeededTicks;
|
||||
if(this.compresser.crafter.currentTickTime != 0){
|
||||
j = this.compresser.crafter.currentTickTime * 20 / this.compresser.crafter.currentNeededTicks;
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect(k + 60, l + 38, 176, 14, j + 1, 16);
|
||||
|
||||
j = this.containerImplosionCompressor.energy * 12 / this.compresser.energy.getCapacity();
|
||||
j = (int) (this.compresser.crafter.energy.getEnergyStored() * 12 / this.compresser.energy.getCapacity());
|
||||
if(j > 0) {
|
||||
this.drawTexturedModalRect(k + 16, l + 37 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ public class GuiLathe extends GuiContainer {
|
|||
|
||||
int j = 0;
|
||||
|
||||
if(this.containerLathe.currentTickTime != 0){
|
||||
j = this.containerLathe.currentTickTime * 20 / this.containerLathe.currentNeededTicks;
|
||||
if(this.lathe.crafter.currentTickTime != 0){
|
||||
j = this.lathe.crafter.currentTickTime * 20 / this.lathe.crafter.currentNeededTicks;
|
||||
}
|
||||
this.drawTexturedModalRect(k + 80, l + 34, 176, 14, j, 16);
|
||||
|
||||
j = this.containerLathe.energy * 12 / this.lathe.energy.getCapacity();
|
||||
j = (int) (this.lathe.energy.getEnergyStored() * 12 / this.lathe.energy.getCapacity());
|
||||
if(j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
|
|
@ -43,12 +43,12 @@ public class GuiPlateCuttingMachine extends GuiContainer {
|
|||
|
||||
int j = 0;
|
||||
|
||||
if(this.containerPlateCuttingMachine.currentTickTime != 0){
|
||||
j = this.containerPlateCuttingMachine.currentTickTime * 20 / this.containerPlateCuttingMachine.currentNeededTicks;
|
||||
if(this.platecuttingmachine.crafter.currentTickTime != 0){
|
||||
j = this.platecuttingmachine.crafter.currentTickTime * 20 / this.platecuttingmachine.crafter.currentNeededTicks;
|
||||
}
|
||||
this.drawTexturedModalRect(k + 83, l + 34, 176, 14, j, 16);
|
||||
|
||||
j = this.containerPlateCuttingMachine.energy * 12 / this.platecuttingmachine.energy.getCapacity();
|
||||
j = (int) (this.platecuttingmachine.energy.getEnergyStored() * 12 / this.platecuttingmachine.energy.getCapacity());
|
||||
if(j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue