Merge remote-tracking branch 'origin/1.16' into 1.16

This commit is contained in:
modmuss50 2020-06-18 15:56:16 +01:00
commit 32468c1c95
2 changed files with 14 additions and 8 deletions

View file

@ -47,10 +47,8 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
super.drawBackground(matrixStack, f, mouseX, mouseY); super.drawBackground(matrixStack, f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND; final Layer layer = Layer.BACKGROUND;
client.textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752); // Draw slots
drawSlot(matrixStack, 100, 53, layer); drawSlot(matrixStack, 100, 53, layer);
client.textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
drawSlot(matrixStack, 140, 53, layer); drawSlot(matrixStack, 140, 53, layer);
} }
@ -58,6 +56,11 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) { protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY); super.drawForeground(matrixStack, mouseX, mouseY);
// Draw in/out labels
drawTextWithShadow(matrixStack, textRenderer, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752);
drawTextWithShadow(matrixStack,textRenderer, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
if (storageEntity.isEmpty() && !storageEntity.isLocked()) { if (storageEntity.isEmpty() && !storageEntity.isLocked()) {
textRenderer.draw(matrixStack, new TranslatableText("techreborn.tooltip.unit.empty"), 10, 20, 4210752); textRenderer.draw(matrixStack, new TranslatableText("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
} else { } else {
@ -69,7 +72,7 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100)); String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100));
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752); textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
} }

View file

@ -47,10 +47,8 @@ public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
super.drawBackground(matrixStack, f, mouseX, mouseY); super.drawBackground(matrixStack, f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND; final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawTextWithShadow(matrixStack, client.textRenderer, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752); // Draw slots
drawSlot(matrixStack, 100, 53, layer); drawSlot(matrixStack, 100, 53, layer);
drawTextWithShadow(matrixStack, client.textRenderer, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
drawSlot(matrixStack, 140, 53, layer); drawSlot(matrixStack, 140, 53, layer);
} }
@ -58,6 +56,11 @@ public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) { protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY); super.drawForeground(matrixStack, mouseX, mouseY);
// Draw input/out
drawTextWithShadow(matrixStack, textRenderer, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752);
drawTextWithShadow(matrixStack, textRenderer, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
FluidInstance fluid = tankEntity.getTank().getFluidInstance(); FluidInstance fluid = tankEntity.getTank().getFluidInstance();
if (fluid.isEmpty()) { if (fluid.isEmpty()) {
@ -72,7 +75,7 @@ public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100)); String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100));
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752); textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
} }