1.16 port

This commit is contained in:
yueh
2020-07-22 16:44:42 +02:00
parent 662dbca3e1
commit 56ecda5173
225 changed files with 1214 additions and 969 deletions
@@ -7,6 +7,7 @@ import javax.annotation.Nullable;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IParts;
@@ -92,10 +93,11 @@ final class AESubScreen {
return addBackButton(buttonAdder, x, y, null);
}
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y, @Nullable String label) {
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y,
@Nullable ITextComponent label) {
if (this.previousContainerType != null && !previousContainerIcon.isEmpty()) {
if (label == null) {
label = previousContainerIcon.getDisplayName().getString();
label = previousContainerIcon.getDisplayName();
}
ItemRenderer itemRenderer = gui.getMinecraft().getItemRenderer();
TabButton button = new TabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon, label,
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
@@ -60,7 +62,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.handleButtonVisibility();
this.bindTexture(this.getBackground());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -41,7 +43,7 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriority()));
}
@@ -50,13 +52,13 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Chest.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture("guis/chest.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -49,21 +51,21 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
this.container.getOutput());
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178,
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal()));
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.textComponent()));
this.addButton(this.mode);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Condenser.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.mode.set(this.container.getOutput());
this.mode.setFillVar(String.valueOf(this.container.getOutput().requiredPower));
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture("guis/condenser.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -54,7 +56,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
this.amountToCraft.addButtons(children::add, this::addButton);
this.next = this.addButton(
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal(), this::confirm));
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.textComponent(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0);
}
@@ -65,20 +67,20 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.SelectAmount.getLocal(), 8, 6, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, GuiText.SelectAmount.textComponent().getString(), 8, 6, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.next.setMessage(hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal());
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.next.setMessage(hasShiftDown() ? GuiText.Start.textComponent() : GuiText.Next.textComponent());
this.bindTexture("guis/craft_amt.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
this.next.active = this.amountToCraft.getValue() > 0;
this.amountToCraft.render(offsetX, offsetY, partialTicks);
this.amountToCraft.render(matrixStack, offsetX, offsetY, partialTicks);
}
@Override
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.List;
import com.google.common.base.Joiner;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.widget.button.Button;
@@ -31,6 +32,7 @@ import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.storage.channels.IItemStorageChannel;
@@ -82,22 +84,23 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
public void init() {
super.init();
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal(),
btn -> start());
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20,
GuiText.Start.textComponent(), btn -> start());
this.start.active = false;
this.addButton(this.start);
this.selectCPU = new Button(this.guiLeft + (219 - 180) / 2, this.guiTop + this.ySize - 68, 180, 20,
GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic, btn -> selectNextCpu());
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic),
btn -> selectNextCpu());
this.selectCPU.active = false;
this.addButton(this.selectCPU);
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal(),
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.textComponent(),
btn -> subGui.goBack()));
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.updateCPUButtonText();
this.start.active = !(this.container.hasNoCPU() || this.isSimulation());
@@ -130,7 +133,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
private void updateCPUButtonText() {
@@ -149,7 +152,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
btnTextText = GuiText.NoCraftingCPUs.getLocal();
}
this.selectCPU.setMessage(btnTextText);
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
}
private boolean isSimulation() {
@@ -157,12 +160,13 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
final long BytesUsed = this.container.getUsedBytes();
final String byteUsed = NumberFormat.getInstance().format(BytesUsed);
final String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal())
: GuiText.CalculatingWait.getLocal();
this.font.drawString(GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752);
this.font.drawString(matrixStack, GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752);
String dsp = null;
@@ -176,7 +180,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
final int offset = (219 - this.font.getStringWidth(dsp)) / 2;
this.font.drawString(dsp, offset, 165, 4210752);
this.font.drawString(matrixStack, dsp, offset, 165, 4210752);
final int sectionLength = 67;
@@ -230,7 +234,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = GuiText.FromStorage.getLocal() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -251,9 +255,9 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = Long.toString(missingStack.getStackSize() / 1000000) + 'm';
}
str = GuiText.Missing.getLocal() + ": " + str;
str = GuiText.Missing.textComponent().getString() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -276,7 +280,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = GuiText.ToCraft.getLocal() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -292,7 +296,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
final ItemStack is = refStack.asItemStackRepresentation();
if (this.tooltip == z - viewStart) {
dspToolTip = Platform.getItemDisplayName(refStack).getFormattedText();
dspToolTip = Platform.getItemDisplayName(refStack).getString();
if (lineList.size() > 0) {
dspToolTip = dspToolTip + '\n' + Joiner.on("\n").join(lineList);
@@ -307,7 +311,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
if (red) {
final int startX = x * (1 + sectionLength) + xo;
final int startY = posY - 4;
fill(startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000);
fill(matrixStack, startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000);
}
x++;
@@ -320,12 +324,13 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
if (this.tooltip >= 0 && !dspToolTip.isEmpty()) {
this.drawTooltip(toolPosX, toolPosY + 10, dspToolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(dspToolTip));
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.setScrollBar();
this.bindTexture("guis/craftingreport.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import org.apache.commons.lang3.time.DurationFormatUtils;
@@ -32,6 +33,7 @@ import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.config.SortDir;
@@ -115,7 +117,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
super.init();
this.setScrollBar();
this.cancel = new Button(this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET,
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.getLocal(), btn -> cancel());
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.textComponent(), btn -> cancel());
this.addButton(this.cancel);
}
@@ -127,7 +129,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.cancel.active = !this.visual.isEmpty();
final int gx = (this.width - this.xSize) / 2;
@@ -157,12 +159,13 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
String title = this.getGuiDisplayName(GuiText.CraftingStatus.getLocal());
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
String title = this.getGuiDisplayName(GuiText.CraftingStatus.textComponent()).getString();
if (this.container.getEstimatedTime() > 0 && !this.visual.isEmpty()) {
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(this.container.getEstimatedTime(),
@@ -172,7 +175,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
title += " - " + etaTimeText;
}
this.font.drawString(title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
this.font.drawString(matrixStack, title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
int x = 0;
int y = 0;
@@ -218,7 +221,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
| BACKGROUND_ALPHA;
final int startX = (x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET) * 2;
final int startY = ((y * offY + ITEMSTACK_TOP_OFFSET) - 3) * 2;
fill(startX, startY, startX + (SECTION_LENGTH * 2), startY + (offY * 2) - 2, bgColor);
fill(matrixStack, startX, startY, startX + (SECTION_LENGTH * 2), startY + (offY * 2) - 2, bgColor);
}
final int negY = ((lines - 1) * 5) / 2;
@@ -228,7 +231,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
final String str = GuiText.Stored.getLocal() + ": "
+ converter.toWideReadableForm(stored.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -245,7 +248,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
+ converter.toWideReadableForm(activeStack.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -262,7 +265,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
+ converter.toWideReadableForm(pendingStack.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -279,7 +282,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
final ItemStack is = refStack.asItemStackRepresentation();
if (this.tooltip == z - viewStart) {
dspToolTip = Platform.getItemDisplayName(refStack).getFormattedText();
dspToolTip = Platform.getItemDisplayName(refStack).getString();
if (lineList.size() > 0) {
dspToolTip = dspToolTip + '\n' + Joiner.on("\n").join(lineList);
@@ -301,12 +304,13 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
if (this.tooltip >= 0 && !dspToolTip.isEmpty()) {
this.drawTooltip(toolPosX, toolPosY + 10, dspToolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(dspToolTip));
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/craftingcpu.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -22,9 +22,12 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.container.implementations.CraftingStatusContainer;
import appeng.core.localization.GuiText;
@@ -48,7 +51,8 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
super.init();
this.selectCPU = new Button(this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20,
GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs, btn -> selectNextCpu());
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs),
btn -> selectNextCpu());
this.addButton(this.selectCPU);
subGui.addBackButton(btn -> {
@@ -58,9 +62,9 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.updateCPUButtonText();
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
private void updateCPUButtonText() {
@@ -80,11 +84,11 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
btnTextText = GuiText.NoCraftingJobs.getLocal();
}
this.selectCPU.setMessage(btnTextText);
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
}
@Override
protected String getGuiDisplayName(final String in) {
protected ITextComponent getGuiDisplayName(final ITextComponent in) {
return in; // the cup name is on the button
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.util.text.ITextComponent;
@@ -61,10 +63,11 @@ public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContaine
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.CraftingTerminal.getLocal(), 8,
this.ySize - 96 + 1 - this.getReservedSpace(), 4210752);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -41,7 +43,7 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
}
@@ -50,13 +52,17 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Drive.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3,
4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/drive.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -50,7 +52,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.placeMode);
@@ -58,9 +60,9 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.FormationPlane.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FormationPlane.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -34,13 +36,13 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.GrindStone.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture("guis/grinder.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -57,9 +59,11 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.IOPort.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.redstoneMode != null) {
this.redstoneMode.set(this.cvb.getRedStoneMode());
@@ -75,8 +79,9 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
final IDefinitions definitions = Api.instance().definitions();
@@ -18,8 +18,11 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen;
@@ -51,15 +54,18 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.pb.setFullMsg(this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%");
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.pb.setFullMsg(new StringTextComponent(
this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%"));
this.font.drawString(this.getGuiDisplayName(GuiText.Inscriber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/inscriber.png");
this.pb.x = 135 + this.guiLeft;
this.pb.y = 39 + this.guiTop;
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -46,7 +48,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
@Override
protected void addButtons() {
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
@@ -59,7 +61,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
if (this.blockMode != null) {
this.blockMode.set(((InterfaceContainer) this.cvb).getBlockingMode());
}
@@ -68,13 +70,13 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
this.font.drawString(this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);
this.font.drawString(GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752);
this.font.drawString(GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752);
this.font.drawString(matrixStack, GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);
this.font.drawString(matrixStack, GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752);
this.font.drawString(matrixStack, GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.WeakHashMap;
import com.google.common.collect.HashMultimap;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import org.lwjgl.glfw.GLFW;
@@ -93,9 +94,9 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.InterfaceTerminal.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
final int ex = this.getScrollBar().getCurrentScroll();
@@ -120,7 +121,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
name = name.substring(0, name.length() - 1);
}
this.font.drawString(name, 10, 6 + offset, 4210752);
this.font.drawString(matrixStack, name, 10, 6 + offset, 4210752);
}
offset += 18;
}
@@ -140,7 +141,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture("guis/interfaceterminal.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -160,7 +161,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
if (this.searchField != null) {
this.searchField.render(mouseX, mouseY, partialTicks);
this.searchField.render(matrixStack, mouseX, mouseY, partialTicks);
}
}
@@ -217,7 +218,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
try {
final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX);
final CompoundNBT invData = in.getCompound(key);
ITextComponent un = ITextComponent.Serializer.fromJson(invData.getString("un"));
ITextComponent un = ITextComponent.Serializer.func_240643_a_(invData.getString("un"));
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
for (int x = 0; x < current.getInventory().getSlots(); x++) {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -77,7 +79,8 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
final boolean notCraftingMode = this.bc.getInstalledUpgrades(Upgrades.CRAFTING) == 0;
// configure enabled status...
@@ -85,7 +88,7 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
this.levelMode.active = notCraftingMode;
this.redstoneMode.active = notCraftingMode;
super.drawFG(offsetX, offsetY, mouseX, mouseY);
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
if (this.craftingMode != null) {
this.craftingMode.set(this.cvb.getCraftingMode());
@@ -97,16 +100,18 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
if (notCraftingMode) {
if (currentLevelMode == LevelType.ENERGY_LEVEL) {
this.font.drawString(PowerUnits.AE.textComponent().getString(), 110, 44, COLOR_DARK_GRAY);
this.font.drawString(matrixStack, PowerUnits.AE.textComponent().getString(), 110, 44,
COLOR_DARK_GRAY);
}
}
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
this.level.render(mouseX, mouseY, partialTicks);
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
this.level.render(matrixStack, mouseX, mouseY, partialTicks);
}
@Override
@@ -20,6 +20,8 @@ package appeng.client.gui.implementations;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.util.InputMappings;
@@ -234,7 +236,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
if (this.viewCell || this instanceof WirelessTermScreen) {
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
GuiText.CraftingStatus.getLocal(), this.itemRenderer, btn -> showCraftingStatus()));
GuiText.CraftingStatus.textComponent(), this.itemRenderer, btn -> showCraftingStatus()));
this.craftingStatusBtn.setHideEdge(13);
}
@@ -284,9 +286,9 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(this.myName.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.currentMouseX = mouseX;
this.currentMouseY = mouseY;
@@ -318,21 +320,21 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture(this.getBackground());
final int x_width = 197;
blit(offsetX, offsetY, 0, 0, x_width, 18);
blit(matrixStack, offsetX, offsetY, 0, 0, x_width, 18);
if (this.viewCell || (this instanceof SecurityStationScreen)) {
blit(offsetX + x_width, offsetY, x_width, 0, 46, 128);
blit(matrixStack, offsetX + x_width, offsetY, x_width, 0, 46, 128);
}
for (int x = 0; x < this.rows; x++) {
blit(offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18);
blit(matrixStack, offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18);
}
blit(offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
blit(matrixStack, offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
99 + this.reservedSpace - this.lowerTextureOffset);
if (this.viewCell) {
@@ -351,7 +353,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
if (this.searchField != null) {
this.searchField.render(mouseX, mouseY, partialTicks);
this.searchField.render(matrixStack, mouseX, mouseY, partialTicks);
}
}
@@ -18,8 +18,11 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings;
@@ -56,16 +59,18 @@ public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssembl
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.pb.setFullMsg(this.container.getCurrentProgress() + "%");
super.drawFG(offsetX, offsetY, mouseX, mouseY);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.pb.setFullMsg(new StringTextComponent(this.container.getCurrentProgress() + "%"));
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.pb.x = 148 + this.guiLeft;
this.pb.y = 48 + this.guiTop;
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
}
@Override
@@ -20,12 +20,14 @@ package appeng.client.gui.implementations;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.config.SortDir;
@@ -68,7 +70,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
final int gx = (this.width - this.xSize) / 2;
final int gy = (this.height - this.ySize) / 2;
@@ -96,23 +98,24 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.NetworkDetails.getLocal(), 8, 6, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.NetworkDetails.getLocal(), 8, 6, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong(container.getCurrentPower(), false),
13, 16, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong(container.getMaxPower(), false), 13, 26,
4210752);
this.font.drawString(GuiText.PowerInputRate.getLocal() + ": "
this.font.drawString(matrixStack, GuiText.PowerInputRate.getLocal() + ": "
+ Platform.formatPowerLong(container.getAverageAddition(), true), 13, 143 - 10, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong(container.getPowerUsage(), true),
13, 143 - 20, 4210752);
@@ -141,7 +144,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
final int w = this.font.getStringWidth(str);
this.font.drawString(str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2),
this.font.drawString(matrixStack, str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * 18 + yo + 6) * 2, 4210752);
RenderSystem.popMatrix();
@@ -149,7 +152,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
final int posY = y * 18 + yo;
if (this.tooltip == z - viewStart) {
toolTip = Platform.getItemDisplayName(refStack).getFormattedText();
toolTip = Platform.getItemDisplayName(refStack).getString();
toolTip += ('\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize()));
if (refStack.getCountRequestable() > 0) {
@@ -173,12 +176,13 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
if (this.tooltip >= 0 && toolTip.length() > 0) {
this.drawTooltip(toolPosX, toolPosY + 10, toolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(toolTip));
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/networkstatus.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -201,7 +205,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
@Override
protected void renderTooltip(final ItemStack stack, final int x, final int y) {
protected void renderTooltip(MatrixStack matrixStack, final ItemStack stack, final int x, final int y) {
final Slot s = this.getSlot(x, y);
if (s instanceof SlotME && !stack.isEmpty()) {
@@ -214,7 +218,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
if (myStack != null) {
List<String> currentToolTip = getTooltipFromItem(stack);
List<ITextComponent> currentToolTip = getTooltipFromItem(stack);
while (currentToolTip.size() > 1) {
currentToolTip.remove(1);
@@ -224,11 +228,11 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true));
this.drawTooltip(x, y, currentToolTip);
this.drawTooltip(matrixStack, x, y, currentToolTip);
}
}
super.renderTooltip(stack, x, y);
super.renderTooltip(matrixStack, stack, x, y);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -54,17 +56,20 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
if (this.tFacades != null) {
this.tFacades.setState(container.isFacadeMode());
}
this.font.drawString(this.getGuiDisplayName(GuiText.NetworkTool.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/toolbox.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -3,9 +3,13 @@ package appeng.client.gui.implementations;
import java.util.function.Consumer;
import java.util.function.LongConsumer;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.IGuiEventListener;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.NumberEntryType;
@@ -19,6 +23,9 @@ import appeng.core.AEConfig;
*/
public class NumberEntryWidget implements ITickingWidget {
private static final ITextComponent PLUS = new StringTextComponent("+");
private static final ITextComponent MINUS = new StringTextComponent("+");
private final AEBaseScreen<?> parent;
private final int x;
@@ -86,18 +93,18 @@ public class NumberEntryWidget implements ITickingWidget {
int left = parent.getGuiLeft() + x;
int top = parent.getGuiTop() + y;
addButton.accept(this.plus1 = new Button(left, top, 22, 20, "+" + a, btn -> addQty(a)));
addButton.accept(this.plus10 = new Button(left + 28, top, 28, 20, "+" + b, btn -> addQty(b)));
addButton.accept(this.plus100 = new Button(left + 62, top, 32, 20, "+" + c, btn -> addQty(c)));
addButton.accept(this.plus1000 = new Button(left + 100, top, 38, 20, "+" + d, btn -> addQty(d)));
addButton.accept(this.plus1 = new Button(left, top, 22, 20, PLUS /* + a */, btn -> addQty(a)));
addButton.accept(this.plus10 = new Button(left + 28, top, 28, 20, PLUS /* + b */, btn -> addQty(b)));
addButton.accept(this.plus100 = new Button(left + 62, top, 32, 20, PLUS /* + c */, btn -> addQty(c)));
addButton.accept(this.plus1000 = new Button(left + 100, top, 38, 20, PLUS/* + d */, btn -> addQty(d)));
// Placing this here will give a sensible tab order
addChildren.accept(this.level);
addButton.accept(this.minus1 = new Button(left, top + 42, 22, 20, "-" + a, btn -> addQty(-a)));
addButton.accept(this.minus10 = new Button(left + 28, top + 42, 28, 20, "-" + b, btn -> addQty(-b)));
addButton.accept(this.minus100 = new Button(left + 62, top + 42, 32, 20, "-" + c, btn -> addQty(-c)));
addButton.accept(this.minus1000 = new Button(left + 100, top + 42, 38, 20, "-" + d, btn -> addQty(-d)));
addButton.accept(this.minus1 = new Button(left, top + 42, 22, 20, MINUS /* + a */, btn -> addQty(-a)));
addButton.accept(this.minus10 = new Button(left + 28, top + 42, 28, 20, MINUS /* + b */, btn -> addQty(-b)));
addButton.accept(this.minus100 = new Button(left + 62, top + 42, 32, 20, MINUS /* + c */, btn -> addQty(-c)));
addButton.accept(this.minus1000 = new Button(left + 100, top + 42, 38, 20, MINUS /* + d */, btn -> addQty(-d)));
}
private void addQty(final long i) {
@@ -106,8 +113,8 @@ public class NumberEntryWidget implements ITickingWidget {
this.level.setText(String.valueOf(Math.max(minValue, currentValue + i)));
}
public void render(int mouseX, int mouseY, float partialTicks) {
this.level.render(mouseX, mouseY, partialTicks);
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
this.level.render(matrixStack, mouseX, mouseY, partialTicks);
}
public void setValue(long value, boolean skipNotify) {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
@@ -58,12 +60,12 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
super.init();
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.getLocal(), this.itemRenderer,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.textComponent(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
this.addButton(this.tabCraftButton);
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRenderer,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.textComponent(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
this.addButton(this.tabProcessButton);
@@ -104,7 +106,8 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
if (this.container.isCraftingMode()) {
this.tabCraftButton.visible = true;
this.tabProcessButton.visible = false;
@@ -123,9 +126,9 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
this.substitutionsDisabledBtn.visible = false;
}
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(),
4210752);
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.PatternTerminal.getLocal(), 8,
this.ySize - 96 + 2 - this.getReservedSpace(), 4210752);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -58,16 +60,18 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.Priority.getLocal(), 8, 6, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.Priority.getLocal(), 8, 6, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture(getBackground());
blit(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
blit(matrixStack, offsetX, offsetY, 0, 0, this.xSize, this.ySize);
this.priority.render(mouseX, mouseY, partialTicks);
this.priority.render(matrixStack, mouseX, mouseY, partialTicks);
}
protected String getBackground() {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -34,13 +36,16 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.QuantumLinkChamber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuantumLinkChamber.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/chest.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,12 +18,15 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.ActionKey;
@@ -47,7 +50,8 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
public void init() {
super.init();
this.name = new TextFieldWidget(this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT, "");
this.name = new TextFieldWidget(this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT,
new StringTextComponent(""));
this.name.setEnableBackgroundDrawing(false);
this.name.setMaxStringLength(32);
this.name.setTextColor(0xFFFFFF);
@@ -56,16 +60,19 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.QuartzCuttingKnife.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/quartzknife.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
this.name.render(mouseX, mouseY, partialTicks);
this.name.render(matrixStack, mouseX, mouseY, partialTicks);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -80,9 +82,9 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
4210752);
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
@@ -38,13 +40,16 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.SkyChest.getLocal()), 8, 8, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.textComponent()).getString(), 8, 8,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
bindTexture(TEXTURE);
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0);
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -43,33 +45,37 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.StoredPower.getLocal() + ": "
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.StoredPower.getLocal() + ": "
+ Platform.formatPowerLong(this.container.getCurrentPower(), false), 13, 21, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong(this.container.getMaxPower(), false), 13,
31, 4210752);
this.font.drawString(GuiText.RequiredPower.getLocal() + ": "
this.font.drawString(matrixStack, GuiText.RequiredPower.getLocal() + ": "
+ Platform.formatPowerLong(this.container.getRequiredPower(), false), 13, 73, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.Efficiency.getLocal() + ": " + (((float) this.container.getEfficency()) / 100) + '%', 13, 83,
4210752);
this.font.drawString(this.getGuiDisplayName(GuiText.SpatialIOPort.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.textComponent()).getString(), 8,
6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
if (this.container.xSize != 0 && this.container.ySize != 0 && this.container.zSize != 0) {
final String text = GuiText.SCSSize.getLocal() + ": " + this.container.xSize + "x" + this.container.ySize
+ "x" + this.container.zSize;
this.font.drawString(text, 13, 93, 4210752);
this.font.drawString(matrixStack, text, 13, 93, 4210752);
} else {
this.font.drawString(GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93, 4210752);
this.font.drawString(matrixStack, GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93,
4210752);
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/spatialio.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -58,7 +60,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.storageFilter);
@@ -67,9 +69,11 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.StorageBus.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -82,9 +84,11 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(this.getName().getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.redstoneMode != null) {
this.redstoneMode.set(this.cvb.getRedStoneMode());
@@ -104,7 +108,8 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.handleButtonVisibility();
this.bindTexture(this.getBackground());
@@ -18,10 +18,12 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen;
@@ -50,12 +52,14 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.VibrationChamber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.textComponent()).getString(),
8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.pb.setFullMsg(VibrationChamberTileEntity.POWER_PER_TICK * this.container.getCurrentProgress()
/ VibrationChamberTileEntity.DILATION_SCALING + " AE/t");
this.pb.setFullMsg(new StringTextComponent(VibrationChamberTileEntity.POWER_PER_TICK
* this.container.getCurrentProgress() / VibrationChamberTileEntity.DILATION_SCALING + " AE/t"));
if (this.container.getRemainingBurnTime() > 0) {
final int i1 = this.container.getRemainingBurnTime() * 12 / 100;
@@ -68,7 +72,8 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
this.bindTexture("guis/vibchamber.png");
this.pb.x = 99 + this.guiLeft;
this.pb.y = 36 + this.guiTop;
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -43,9 +45,9 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Wireless.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Wireless.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (container.getRange() > 0) {
final String firstMessage = GuiText.Range.getLocal() + ": " + (container.getRange() / 10.0) + " m";
@@ -55,13 +57,13 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
final int strWidth = Math.max(this.font.getStringWidth(firstMessage),
this.font.getStringWidth(secondMessage));
final int cOffset = (this.xSize / 2) - (strWidth / 2);
this.font.drawString(firstMessage, cOffset, 20, 4210752);
this.font.drawString(secondMessage, cOffset, 20 + 12, 4210752);
this.font.drawString(matrixStack, firstMessage, cOffset, 20, 4210752);
this.font.drawString(matrixStack, secondMessage, cOffset, 20 + 12, 4210752);
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.bindTexture("guis/wireless.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}