Fixed some LESU things

EU/t and capacity are now config-driven. Note that while the "max-eu" updates when you remove LESU storage blocks, it's currently retaining the highest EU/t you get, so if you remove blocks, the GUI still says it has the same EU/t you had before you removed them. Also shortened EU display.
This commit is contained in:
joflashstudios 2015-06-19 22:31:56 -04:00
parent 238901323c
commit 4fb6f4aca6
5 changed files with 48 additions and 13 deletions

View file

@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLesu extends TechRebornContainer {
@ -96,7 +97,7 @@ public class ContainerLesu extends TechRebornContainer {
} else if(id == 4){
this.euStorage = value;
}
this.euStorage = (connectedBlocks * 100000) + 1000000000;
this.euStorage = ((connectedBlocks + 1) * ConfigTechReborn.lesuStoragePerBlock);
}
}

View file

@ -47,10 +47,25 @@ public class GuiLesu extends GuiContainer {
int p_146979_2_)
{
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString((int)containerLesu.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString((int)containerLesu.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString((int)containerLesu.euChange + " eu change", 10, 40, Color.WHITE.getRGB());
this.fontRendererObj.drawString((int)containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
// this.fontRendererObj.drawString((int)containerLesu.euStorage + " max eu", 10, 60, Color.WHITE.getRGB());
this.fontRendererObj.drawString(GetEUString(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString(GetEUString(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString(GetEUString(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
this.fontRendererObj.drawString(GetEUString(containerLesu.euStorage) + " max", 10, 60, Color.WHITE.getRGB());
}
private String GetEUString(double euValue)
{
if (euValue >= 1000000) {
double tenX = Math.round(euValue / 100000);
return Double.toString(tenX / 10.0).concat(" m EU");
}
else if (euValue >= 1000) {
double tenX = Math.round(euValue / 100);
return Double.toString(tenX / 10.0).concat(" k EU");
}
else {
return Double.toString(Math.floor(euValue)).concat(" EU");
}
}
}

View file

@ -116,7 +116,11 @@ public class ChargeHud
private String GetEUString(double euValue)
{
if (euValue > 1000) {
if (euValue > 1000000) {
double tenX = Math.round(euValue / 100000);
return Double.toString(tenX / 10.0).concat(" m EU");
}
else if (euValue > 1000) {
double tenX = Math.round(euValue / 100);
return Double.toString(tenX / 10.0).concat(" k EU");
}