Added Fusion Reactor
This commit is contained in:
parent
473a981f51
commit
a63128aa7e
6 changed files with 175 additions and 3 deletions
|
@ -14,6 +14,9 @@ public class ContainerFusionReactor extends RebornContainer {
|
|||
|
||||
public int coilStatus;
|
||||
public int energy;
|
||||
public int tickTime;
|
||||
public int finalTickTime;
|
||||
public int neededEU;
|
||||
|
||||
TileEntityFusionController fusionController;
|
||||
|
||||
|
@ -58,6 +61,15 @@ public class ContainerFusionReactor extends RebornContainer {
|
|||
if (this.energy != (int) fusionController.getEnergy()) {
|
||||
icrafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
||||
}
|
||||
if (this.tickTime != fusionController.crafingTickTime) {
|
||||
icrafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
|
||||
}
|
||||
if (this.finalTickTime != fusionController.finalTickTime) {
|
||||
icrafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
|
||||
}
|
||||
if (this.neededEU != fusionController.neededPower) {
|
||||
icrafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +78,9 @@ public class ContainerFusionReactor extends RebornContainer {
|
|||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
|
||||
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
||||
crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
|
||||
crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
|
||||
crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -75,6 +90,16 @@ public class ContainerFusionReactor extends RebornContainer {
|
|||
this.coilStatus = value;
|
||||
} else if (id == 1) {
|
||||
this.energy = value;
|
||||
} else if(id == 2){
|
||||
this.tickTime = value;
|
||||
} else if(id == 3){
|
||||
this.finalTickTime = value;
|
||||
} else if(id == 4){
|
||||
this.neededEU = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int getProgressScaled(){
|
||||
return Math.max(0, Math.min(24, (this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
|
||||
this.fontRendererObj.drawString("EU: " + containerFusionReactor.energy, 11, 8, 16448255);
|
||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No") , 11, 16, 16448255);
|
||||
this.fontRendererObj.drawString("Start EU: " + containerFusionReactor.neededEU, 11, 24, 16448255);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +42,7 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14);
|
||||
|
||||
//progressBar
|
||||
drawTexturedModalRect(k + 111, l + 34, 176, 14, 24, 16);
|
||||
drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue