Polish to the reactor
This commit is contained in:
parent
b506c2e091
commit
7db2e0dc8c
6 changed files with 132 additions and 76 deletions
|
@ -97,6 +97,15 @@ public class ContainerFusionReactor extends RebornContainer {
|
|||
} else if(id == 4){
|
||||
this.neededEU = value;
|
||||
}
|
||||
if(tickTime == -1){
|
||||
tickTime = 0;
|
||||
}
|
||||
if(finalTickTime == -1){
|
||||
finalTickTime = 0;
|
||||
}
|
||||
if(neededEU == -1){
|
||||
neededEU = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int getProgressScaled(){
|
||||
|
|
|
@ -27,8 +27,8 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
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);
|
||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, 16448255);
|
||||
this.fontRendererObj.drawString("Start EU: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy), 11, 24, 16448255);
|
||||
|
||||
}
|
||||
|
||||
|
@ -45,4 +45,10 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16);
|
||||
|
||||
}
|
||||
|
||||
public int percentage(int MaxValue, int CurrentValue) {
|
||||
if (CurrentValue == 0)
|
||||
return 0;
|
||||
return (int) ((CurrentValue * 100.0f) / MaxValue);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue