Compiles again.

This commit is contained in:
Sebastian Hartte
2020-07-27 23:50:28 +02:00
parent 56ecda5173
commit 84e6aaa122
136 changed files with 1004 additions and 1108 deletions
@@ -61,31 +61,23 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
if (myStack != null) {
if (myStack.getStackSize() > bigNumber || (myStack.getStackSize() > 1 && stack.isDamaged())) {
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
.format(myStack.getStackSize());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
}
if (myStack.getCountRequestable() > 0) {
final String local = ButtonToolTips.ItemsRequestable.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
.format(myStack.getCountRequestable());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(format));
currentToolTip.add(ButtonToolTips.ItemsRequestable.text(formattedAmount));
}
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
return;
} else if (stack.getCount() > bigNumber) {
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
@@ -31,6 +32,7 @@ import com.google.common.collect.Lists;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.util.text.Style;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
@@ -145,7 +147,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
RenderSystem.popMatrix();
RenderSystem.enableDepthTest();
this.renderHoveredToolTip(matrixStack, mouseX, mouseY);
this.func_230459_a_(matrixStack, mouseX, mouseY);
for (final Object c : this.buttons) {
if (c instanceof ITooltip) {
@@ -189,33 +191,35 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
protected void drawTooltip(MatrixStack matrixStack, int x, int y, ITextComponent message) {
String[] lines = message.split("\n");
this.drawTooltip(matrixStack, x, y, Arrays.asList(lines));
protected void drawTooltip(MatrixStack matrices, int x, int y, ITextComponent message) {
String[] lines = message.getString().split("\n"); // FIXME FABRIC
List<ITextComponent> textLines = Arrays.stream(lines).map(StringTextComponent::new).collect(Collectors.toList());
this.drawTooltip(matrices, x, y, textLines);
}
protected void drawTooltip(MatrixStack matrixStack, int x, int y, List<String> lines) {
// FIXME FABRIC: move out to json (?)
private static final Style TOOLTIP_HEADER = Style.EMPTY.applyFormatting(TextFormatting.WHITE);
private static final Style TOOLTIP_BODY = Style.EMPTY.applyFormatting(TextFormatting.GRAY);
protected void drawTooltip(MatrixStack matrices, int x, int y, List<ITextComponent> lines) {
if (lines.isEmpty()) {
return;
}
// For an explanation of the formatting codes, see
// http://minecraft.gamepedia.com/Formatting_codes
lines = Lists.newArrayList(lines); // Make a copy
// Make the first line white
lines.set(0, TextFormatting.WHITE + lines.get(0));
// All lines after the first are colored gray
for (int i = 1; i < lines.size(); i++) {
lines.set(i, TextFormatting.GRAY + lines.get(i));
List<ITextComponent> styledLines = new ArrayList<>(lines.size());
for (int i = 0; i < lines.size(); i++) {
Style style = (i == 0) ? TOOLTIP_HEADER : TOOLTIP_BODY;
styledLines.add(lines.get(i).deepCopy().func_240700_a_(s -> style));
}
this.renderTooltip(matrixStack, lines, x, y, this.font);
this.renderTooltip(matrices, styledLines, x, y);
}
@Override
protected final void drawGuiContainerForegroundLayer(MatrixStack matrixStack, final int x, final int y) {
protected final void func_230451_b_(MatrixStack matrixStack, final int x, final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -230,7 +234,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
public abstract void drawFG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY);
@Override
protected final void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, final float f, final int x,
protected final void func_230450_a_(MatrixStack matrixStack, final float f, final int x,
final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
@@ -627,16 +631,16 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
* hackery...
*/
@Override
public void drawSlot(MatrixStack matrixStack, Slot s) {
public void func_238746_a_(MatrixStack matrices, Slot s) {
if (s instanceof SlotME) {
try {
if (!this.isPowered()) {
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
// Annoying but easier than trying to splice into render item
super.drawSlot(new Size1Slot((SlotME) s));
super.func_238746_a_(matrices, new Size1Slot((SlotME) s));
this.stackSizeRenderer.renderStackSize(this.font, ((SlotME) s).getAEStack(), s.xPos, s.yPos);
@@ -665,13 +669,13 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
float blue = (fluidAttributes.getColor() & 255) / 255.0F;
RenderSystem.color3f(red, green, blue);
blit(matrixStack, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
blit(matrices, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
sprite);
RenderSystem.enableBlend();
this.fluidStackSizeRenderer.renderStackSize(this.font, fs, s.xPos, s.yPos);
} else if (!this.isPowered()) {
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
return;
@@ -743,7 +747,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
setBlitOffset(100);
this.itemRenderer.zLevel = 100.0F;
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
setBlitOffset(0);
this.itemRenderer.zLevel = 0.0F;
@@ -752,9 +756,9 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
if (s instanceof AppEngSlot) {
((AppEngSlot) s).setDisplay(true);
super.drawSlot(s);
super.func_238746_a_(matrices, s);
} else {
super.drawSlot(s);
super.func_238746_a_(matrices, s);
}
return;
@@ -763,7 +767,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
// do the usual for non-ME Slots.
super.drawSlot(s);
super.func_238746_a_(matrices, s);
}
protected boolean isPowered() {
@@ -800,10 +804,4 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
@Override
protected void func_230450_a_(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) {
// TODO Auto-generated method stub
}
}
@@ -43,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.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriority()));
}
@@ -53,8 +53,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
@Override
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);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -51,14 +51,14 @@ 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.textComponent()));
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.text()));
this.addButton(this.mode);
}
@Override
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.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
this.mode.set(this.container.getOutput());
this.mode.setFillVar(String.valueOf(this.container.getOutput().requiredPower));
@@ -56,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.textComponent(), this::confirm));
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.text(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0);
}
@@ -68,12 +68,12 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
@Override
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);
this.font.drawString(matrixStack, GuiText.SelectAmount.text().getString(), 8, 6, 4210752);
}
@Override
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.next.setMessage(hasShiftDown() ? GuiText.Start.text() : GuiText.Next.text());
this.bindTexture("guis/craft_amt.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -85,7 +85,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
super.init();
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20,
GuiText.Start.textComponent(), btn -> start());
GuiText.Start.text(), btn -> start());
this.start.active = false;
this.addButton(this.start);
@@ -95,7 +95,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
this.selectCPU.active = false;
this.addButton(this.selectCPU);
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.textComponent(),
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.text(),
btn -> subGui.goBack()));
}
@@ -255,7 +255,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = Long.toString(missingStack.getStackSize() / 1000000) + 'm';
}
str = GuiText.Missing.textComponent().getString() + ": " + str;
str = GuiText.Missing.text().getString() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
@@ -117,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.textComponent(), btn -> cancel());
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.text(), btn -> cancel());
this.addButton(this.cancel);
}
@@ -165,7 +165,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
@Override
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();
String title = this.getGuiDisplayName(GuiText.CraftingStatus.text()).getString();
if (this.container.getEstimatedTime() > 0 && !this.visual.isEmpty()) {
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(this.container.getEstimatedTime(),
@@ -43,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.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
}
@@ -54,9 +54,9 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
@Override
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,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3,
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3,
4210752);
}
@@ -52,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.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.placeMode);
@@ -61,7 +61,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
@Override
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, this.getGuiDisplayName(GuiText.FormationPlane.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
@@ -37,8 +37,8 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
@Override
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);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -61,7 +61,7 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
@Override
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,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -59,8 +59,8 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
this.pb.setFullMsg(new StringTextComponent(
this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%"));
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);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -48,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.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
@@ -70,7 +70,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.text()).getString(), 8, 6, 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);
@@ -95,8 +95,8 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
@Override
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);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
final int ex = this.getScrollBar().getCurrentScroll();
@@ -236,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.textComponent(), this.itemRenderer, btn -> showCraftingStatus()));
GuiText.CraftingStatus.text(), this.itemRenderer, btn -> showCraftingStatus()));
this.craftingStatusBtn.setHideEdge(13);
}
@@ -287,8 +287,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
@Override
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.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
this.currentMouseX = mouseX;
this.currentMouseY = mouseY;
@@ -224,9 +224,9 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
currentToolTip.remove(1);
}
currentToolTip.add(GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()));
currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true));
currentToolTip.add(GuiText.Installed.withSuffix(": " + (myStack.getStackSize())));
currentToolTip.add(GuiText.EnergyDrain.withSuffix(": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true)));
this.drawTooltip(matrixStack, x, y, currentToolTip);
}
@@ -62,7 +62,7 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
this.tFacades.setState(container.isFacadeMode());
}
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -60,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.textComponent(), this.itemRenderer,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.text(), 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.textComponent(), this.itemRenderer,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.text(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
this.addButton(this.tabProcessButton);
@@ -39,7 +39,7 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
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.getGuiDisplayName(GuiText.QuantumLinkChamber.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -63,7 +63,7 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
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.getGuiDisplayName(GuiText.QuartzCuttingKnife.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -42,7 +42,7 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
@Override
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,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.text()).getString(), 8, 8,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
}
@@ -58,7 +58,7 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
GuiText.Efficiency.getLocal() + ": " + (((float) this.container.getEfficency()) / 100) + '%', 13, 83,
4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.textComponent()).getString(), 8,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.text()).getString(), 8,
6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
@@ -60,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.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.storageFilter);
@@ -71,7 +71,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
@Override
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,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -86,7 +86,7 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
@Override
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,
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -54,7 +54,7 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
@Override
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(),
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.text()).getString(),
8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -46,7 +46,7 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
@Override
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, this.getGuiDisplayName(GuiText.Wireless.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (container.getRange() > 0) {
@@ -23,6 +23,8 @@ import java.util.regex.Pattern;
import appeng.api.config.ActionItems;
import appeng.core.localization.ButtonToolTips;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class ActionButton extends IconButton implements ITooltip {
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
@@ -76,9 +78,9 @@ public class ActionButton extends IconButton implements ITooltip {
return iconIndex;
}
private String buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.getTranslationKey().getString();
String value = displayValue.getTranslationKey().getString();
private ITextComponent buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.text().getString();
String value = displayValue.text().getString();
value = PATTERN_NEW_LINE.matcher(value).replaceAll("\n");
final StringBuilder sb = new StringBuilder(value);
@@ -91,7 +93,7 @@ public class ActionButton extends IconButton implements ITooltip {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
}
@@ -89,7 +89,7 @@ public class ProgressBar extends Widget implements ITooltip {
return result.deepCopy().func_240702_b_("\n").func_240702_b_(this.source.getCurrentProgress() + " ")
.func_230529_a_(
GuiText.Of.textComponent().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
GuiText.Of.text().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
}
@Override
@@ -48,6 +48,7 @@ import appeng.api.config.ViewItems;
import appeng.api.config.YesNo;
import appeng.core.localization.ButtonToolTips;
import appeng.util.EnumCycler;
import net.minecraft.util.text.StringTextComponent;
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static final Pattern COMPILE = Pattern.compile("%s");
@@ -236,7 +237,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ITextComponent hint) {
final ButtonAppearance a = new ButtonAppearance();
a.displayName = title.getTranslationKey();
a.displayName = title.text();
a.displayValue = hint;
a.index = iconIndex;
appearances.put(new EnumPair(setting, val), a);
@@ -244,7 +245,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ButtonToolTips hint) {
registerApp(iconIndex, setting, val, title, hint.getTranslationKey());
registerApp(iconIndex, setting, val, title, hint.text());
}
@Override
@@ -278,7 +279,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
ITextComponent displayName = null;
ITextComponent displayValue = null;
@@ -286,7 +287,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
final ButtonAppearance buttonAppearance = appearances
.get(new EnumPair(this.buttonSetting, this.currentValue));
if (buttonAppearance == null) {
return "No Such Message";
return new StringTextComponent("No Such Message");
}
displayName = buttonAppearance.displayName;
@@ -312,9 +313,9 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
return "";
return StringTextComponent.EMPTY;
}
public String getFillVar() {