Added spotless back and reformatted

This commit is contained in:
Sebastian Hartte
2020-07-27 20:07:27 +02:00
parent 49296915c9
commit 780f68952b
593 changed files with 4192 additions and 3969 deletions
@@ -24,8 +24,8 @@ import java.util.Locale;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.slot.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
@@ -61,8 +61,7 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
if (myStack.getStackSize() > bigNumber || (myStack.getStackSize() > 1 && stack.isDamaged())) {
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
.format(myStack.getStackSize());
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount)
.formatted(Formatting.GRAY));
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).formatted(Formatting.GRAY));
}
if (myStack.getCountRequestable() > 0) {
@@ -18,9 +18,47 @@
package appeng.client.gui;
import java.util.ArrayList;
import java.util.Arrays;
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;
import com.mojang.blaze3d.systems.RenderSystem;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import alexiil.mc.lib.attributes.fluid.render.FluidRenderFace;
import alexiil.mc.lib.attributes.fluid.render.FluidVolumeRenderer;
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.CustomSlotWidget;
@@ -52,40 +90,6 @@ import appeng.fluids.client.render.FluidStackSizeRenderer;
import appeng.fluids.container.slots.IMEFluidSlot;
import appeng.helpers.InventoryAction;
import appeng.mixins.SlotMixin;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScreen<T> {
@@ -161,7 +165,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
}
}
protected void drawGuiSlot(MatrixStack matrices, CustomSlotWidget slot, int mouseX, int mouseY, float partialTicks) {
protected void drawGuiSlot(MatrixStack matrices, CustomSlotWidget slot, int mouseX, int mouseY,
float partialTicks) {
if (slot.isSlotEnabled()) {
final int left = slot.xPos();
final int top = slot.yPos();
@@ -252,13 +257,13 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
if (optionalSlot.isRenderDisabled()) {
final AppEngSlot aeSlot = (AppEngSlot) slot;
if (aeSlot.isSlotEnabled()) {
drawTexture(matrices, ox + aeSlot.x - 1, oy + aeSlot.y - 1,
optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1, 18, 18);
drawTexture(matrices, ox + aeSlot.x - 1, oy + aeSlot.y - 1, optionalSlot.getSourceX() - 1,
optionalSlot.getSourceY() - 1, 18, 18);
} else {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 0.4F);
RenderSystem.enableBlend();
drawTexture(matrices, ox + aeSlot.x - 1, oy + aeSlot.y - 1,
optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1, 18, 18);
drawTexture(matrices, ox + aeSlot.x - 1, oy + aeSlot.y - 1, optionalSlot.getSourceX() - 1,
optionalSlot.getSourceY() - 1, 18, 18);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
}
}
@@ -314,8 +319,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
if (this.drag_click.size() > 1) {
for (final Slot dr : this.drag_click) {
final InventoryActionPacket p = new InventoryActionPacket(
mouseButton == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
dr.id, 0);
mouseButton == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.id,
0);
NetworkHandler.instance().sendToServer(p);
}
}
@@ -329,7 +334,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
// TODO 1.9.4 aftermath - Whole SlotActionType thing, to be checked.
@Override
protected void onMouseClick(final Slot slot, final int slotIdx, final int mouseButton,
final SlotActionType clickType) {
final SlotActionType clickType) {
final PlayerEntity player = getPlayer();
if (slot instanceof FakeSlot) {
@@ -534,10 +539,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
return true;
} else {
for (final Slot s : slots) {
if (getSlotIndex(s) == j
&& s.inventory == this.handler.getPlayerInv()) {
NetworkHandler.instance()
.sendToServer(new SwapSlotsPacket(s.id, theSlot.id));
if (getSlotIndex(s) == j && s.inventory == this.handler.getPlayerInv()) {
NetworkHandler.instance().sendToServer(new SwapSlotsPacket(s.id, theSlot.id));
return true;
}
}
@@ -566,7 +569,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
return null;
}
public abstract void drawBG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY, float partialTicks);
public abstract void drawBG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY,
float partialTicks);
@Override
public boolean mouseScrolled(double x, double y, double wheelDelta) {
@@ -702,21 +706,16 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
final float par6 = 16;
vb.vertex(par1 + 0, par2 + par6, getZOffset())
.color(1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon())
.texture((par3 + 0) * f, (par4 + par6) * f1)
.next();
.texture((par3 + 0) * f, (par4 + par6) * f1).next();
final float par5 = 16;
vb.vertex(par1 + par5, par2 + par6, getZOffset())
.color(1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon())
.texture((par3 + par5) * f, (par4 + par6) * f1)
.next();
.texture((par3 + par5) * f, (par4 + par6) * f1).next();
vb.vertex(par1 + par5, par2 + 0, getZOffset())
.color(1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon())
.texture((par3 + par5) * f, (par4 + 0) * f1)
.next();
vb.vertex(par1 + 0, par2 + 0, getZOffset())
.color(1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon())
.texture((par3 + 0) * f, (par4 + 0) * f1)
.next();
.texture((par3 + par5) * f, (par4 + 0) * f1).next();
vb.vertex(par1 + 0, par2 + 0, getZOffset()).color(1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon())
.texture((par3 + 0) * f, (par4 + 0) * f1).next();
tessellator.draw();
} catch (final Exception err) {
@@ -728,9 +727,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
if (!is.isEmpty() && s instanceof AppEngSlot) {
AppEngSlot aeSlot = (AppEngSlot) s;
if (aeSlot.getIsValid() == CalculatedValidity.NotAvailable) {
boolean isValid = s.canInsert(is) || s instanceof OutputSlot
|| s instanceof AppEngCraftingSlot || s instanceof DisabledSlot
|| s instanceof InaccessibleSlot || s instanceof FakeSlot
boolean isValid = s.canInsert(is) || s instanceof OutputSlot || s instanceof AppEngCraftingSlot
|| s instanceof DisabledSlot || s instanceof InaccessibleSlot || s instanceof FakeSlot
|| s instanceof RestrictedInputSlot || s instanceof SlotDisconnected;
if (isValid && s instanceof RestrictedInputSlot) {
try {
@@ -4,15 +4,17 @@ package appeng.client.gui;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import appeng.client.me.SlotME;
import com.mojang.datafixers.util.Pair;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.screen.slot.Slot;
import net.minecraft.item.ItemStack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.util.Identifier;
import appeng.client.me.SlotME;
/**
* A proxy for a slot that will always return an itemstack with size 1, if there
* is an item in the slot. Used to prevent the default item count from
@@ -5,8 +5,9 @@ import java.util.function.Consumer;
import javax.annotation.Nullable;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.text.Text;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IParts;
@@ -26,7 +27,6 @@ import appeng.parts.reporting.CraftingTerminalPart;
import appeng.parts.reporting.PatternTerminalPart;
import appeng.parts.reporting.TerminalPart;
import appeng.tile.storage.ChestBlockEntity;
import net.minecraft.text.Text;
/**
* Utility class for sub-screens of other containers that allow returning to the
@@ -99,8 +99,8 @@ final class AESubScreen {
label = previousContainerIcon.getName();
}
ItemRenderer itemRenderer = gui.getClient().getItemRenderer();
TabButton button = new TabButton(gui.getX() + x, gui.getY() + y, previousContainerIcon, label,
itemRenderer, btn -> goBack());
TabButton button = new TabButton(gui.getX() + x, gui.getY() + y, previousContainerIcon, label, itemRenderer,
btn -> goBack());
buttonAdder.accept(button);
return button;
}
@@ -43,35 +43,33 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
private ToggleButton copyMode;
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory,
Text title) {
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.backgroundHeight = 251;
}
@Override
protected void addButtons() {
this.fuzzyMode = this.addButton(new SettingToggleButton<>(this.x - 18, this.y + 68,
Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL, this::toggleFuzzyMode));
this.addButton(
new ActionButton(this.x - 18, this.y + 28, ActionItems.WRENCH, act1 -> action("Partition")));
this.fuzzyMode = this.addButton(new SettingToggleButton<>(this.x - 18, this.y + 68, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL, this::toggleFuzzyMode));
this.addButton(new ActionButton(this.x - 18, this.y + 28, ActionItems.WRENCH, act1 -> action("Partition")));
this.addButton(new ActionButton(this.x - 18, this.y + 8, ActionItems.CLOSE, act -> action("Clear")));
this.copyMode = this.addButton(new ToggleButton(this.x - 18, this.y + 48, 11 * 16 + 5, 12 * 16 + 5,
GuiText.CopyMode.text(), GuiText.CopyModeDesc.text(), act -> action("CopyMode")));
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.handleButtonVisibility();
this.bindTexture(this.getBackground());
drawTexture(matrices, offsetX, offsetY, 0, 0, 211 - 34, this.backgroundHeight);
if (this.drawUpgrades()) {
if (this.handler.availableUpgrades() <= 8) {
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35,
7 + this.handler.availableUpgrades() * 18);
drawTexture(matrices, offsetX + 177, offsetY + (7 + (this.handler.availableUpgrades()) * 18),
177, 151, 35, 7);
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35, 7 + this.handler.availableUpgrades() * 18);
drawTexture(matrices, offsetX + 177, offsetY + (7 + (this.handler.availableUpgrades()) * 18), 177, 151,
35, 7);
} else if (this.handler.availableUpgrades() <= 16) {
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18);
drawTexture(matrices, offsetX + 177, offsetY + (7 + (8) * 18), 177, 151, 35, 7);
@@ -81,8 +79,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
if (dx == 8) {
drawTexture(matrices, offsetX + 177 + 27, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7);
} else {
drawTexture(matrices, offsetX + 177 + 27 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151,
35 - 8, 7);
drawTexture(matrices, offsetX + 177 + 27 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8, 7);
}
} else {
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18);
@@ -94,11 +91,10 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
final int dx = this.handler.availableUpgrades() - 16;
drawTexture(matrices, offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18);
if (dx == 8) {
drawTexture(matrices, offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8,
7);
drawTexture(matrices, offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7);
} else {
drawTexture(matrices, offsetX + 177 + 27 + 18 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151,
35 - 8, 7);
drawTexture(matrices, offsetX + 177 + 27 + 18 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8,
7);
}
}
}
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.TabButton;
import appeng.container.implementations.ChestContainer;
@@ -42,8 +41,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriority()));
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(), this.itemRenderer,
btn -> openPriority()));
}
private void openPriority() {
@@ -57,7 +56,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/chest.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.api.config.CondenserOutput;
import appeng.api.config.Settings;
import appeng.client.gui.AEBaseScreen;
@@ -49,8 +48,8 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
this.mode = new ServerSettingToggleButton<>(128 + this.x, 52 + this.y, Settings.CONDENSER_OUTPUT,
this.handler.getOutput());
this.addButton(new ProgressBar(this.handler, "guis/condenser.png", 120 + this.x, 25 + this.y, 178,
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.text()));
this.addButton(new ProgressBar(this.handler, "guis/condenser.png", 120 + this.x, 25 + this.y, 178, 25, 6, 18,
Direction.VERTICAL, GuiText.StoredEnergy.text()));
this.addButton(this.mode);
}
@@ -64,7 +63,8 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/condenser.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
@@ -23,7 +23,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.NumberEntryType;
import appeng.container.implementations.CraftAmountContainer;
@@ -54,8 +53,8 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
this.amountToCraft.setMinValue(1);
this.amountToCraft.addButtons(children::add, this::addButton);
this.next = this.addButton(
new ButtonWidget(this.x + 128, this.y + 51, 38, 20, GuiText.Next.text(), this::confirm));
this.next = this
.addButton(new ButtonWidget(this.x + 128, this.y + 51, 38, 20, GuiText.Next.text(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0);
}
@@ -71,7 +70,8 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.next.setMessage(hasShiftDown() ? GuiText.Start.text() : GuiText.Next.text());
this.bindTexture("guis/craft_amt.png");
@@ -33,7 +33,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
@@ -171,8 +170,8 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
dsp = GuiText.Simulation.text();
} else {
dsp = this.handler.getCpuAvailableBytes() > 0
? (GuiText.Bytes.withSuffix(": " + this.handler.getCpuAvailableBytes() + " : ").append(
GuiText.CoProcessors.text()).append(": " + this.handler.getCpuCoProcessors()))
? (GuiText.Bytes.withSuffix(": " + this.handler.getCpuAvailableBytes() + " : ")
.append(GuiText.CoProcessors.text()).append(": " + this.handler.getCpuCoProcessors()))
: GuiText.Bytes.withSuffix(": N/A : ").append(GuiText.CoProcessors.text()).append(": N/A");
}
@@ -326,7 +325,8 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.setScrollBar();
this.bindTexture("guis/craftingreport.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
@@ -26,15 +26,14 @@ import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.util.math.MatrixStack;
import org.apache.commons.lang3.time.DurationFormatUtils;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import appeng.api.config.SortDir;
import appeng.api.config.SortOrder;
import appeng.api.config.ViewItems;
@@ -307,7 +306,8 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/craftingcpu.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -34,8 +34,7 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
private ButtonWidget selectCPU;
public CraftingStatusScreen(CraftingStatusContainer container, PlayerInventory playerInventory,
Text title) {
public CraftingStatusScreen(CraftingStatusContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.subGui = new AESubScreen(this, container.getTarget());
}
@@ -64,8 +64,8 @@ public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContaine
@Override
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
this.textRenderer.draw(matrices, GuiText.CraftingTerminal.text(), 8, this.backgroundHeight - 96 + 1 - this.getReservedSpace(),
4210752);
this.textRenderer.draw(matrices, GuiText.CraftingTerminal.text(), 8,
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
}
@Override
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.TabButton;
import appeng.container.implementations.DriveContainer;
@@ -42,8 +41,8 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(), this.itemRenderer,
btn -> openPriorityGui()));
}
private void openPriorityGui() {
@@ -57,7 +56,8 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/drive.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -38,21 +38,19 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
private SettingToggleButton<YesNo> placeMode;
public FormationPlaneScreen(FormationPlaneContainer container, PlayerInventory playerInventory,
Text title) {
public FormationPlaneScreen(FormationPlaneContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.backgroundHeight = 251;
}
@Override
protected void addButtons() {
this.placeMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, Settings.PLACE_BLOCK,
YesNo.YES);
this.placeMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, Settings.PLACE_BLOCK, YesNo.YES);
this.fuzzyMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(), this.itemRenderer,
btn -> openPriorityGui()));
this.addButton(this.placeMode);
this.addButton(this.fuzzyMode);
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.container.implementations.GrinderContainer;
import appeng.core.localization.GuiText;
@@ -41,7 +40,8 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/grinder.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -47,13 +47,13 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
protected void addButtons() {
this.fullMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8, Settings.FULLNESS_MODE,
FullnessMode.EMPTY);
this.operationMode = new ServerSettingToggleButton<>(this.x + 80, this.y + 17,
Settings.OPERATION_MODE, OperationMode.EMPTY);
this.operationMode = new ServerSettingToggleButton<>(this.x + 80, this.y + 17, Settings.OPERATION_MODE,
OperationMode.EMPTY);
this.addButton(this.operationMode);
this.addButton(this.fullMode);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28,
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, Settings.REDSTONE_CONTROLLED,
RedstoneMode.IGNORE);
addButton(this.redstoneMode);
}
@@ -76,7 +76,8 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
super.drawBG(matrices, offsetX, offsetY, mouseX, mouseY, partialTicks);
final IDefinitions definitions = Api.instance().definitions();
@@ -23,7 +23,6 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.ProgressBar;
import appeng.client.gui.widgets.ProgressBar.Direction;
@@ -54,14 +53,16 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
@Override
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.pb.setFullMsg(new LiteralText(this.handler.getCurrentProgress() * 100 / this.handler.getMaxProgress() + "%"));
this.pb.setFullMsg(
new LiteralText(this.handler.getCurrentProgress() * 100 / this.handler.getMaxProgress() + "%"));
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Inscriber.text()), 8, 6, 4210752);
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/inscriber.png");
this.pb.x = 135 + this.x;
this.pb.y = 39 + this.y;
@@ -69,11 +70,11 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
drawTexture(matrices, offsetX, offsetY, 0, 0, 211 - 34, this.backgroundHeight);
if (this.drawUpgrades()) {
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35,
14 + this.handler.availableUpgrades() * 18);
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35, 14 + this.handler.availableUpgrades() * 18);
}
if (this.hasToolbox()) {
drawTexture(matrices, offsetX + 178, offsetY + this.backgroundHeight - 90, 178, this.backgroundHeight - 90, 68, 68);
drawTexture(matrices, offsetX + 178, offsetY + this.backgroundHeight - 90, 178, this.backgroundHeight - 90,
68, 68);
}
}
@@ -47,15 +47,14 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
@Override
protected void addButtons() {
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(), this.itemRenderer,
btn -> openPriorityGui()));
this.blockMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8, Settings.BLOCK, YesNo.NO);
this.addButton(this.blockMode);
this.interfaceMode = new ToggleButton(this.x - 18, this.y + 26, 84, 85,
GuiText.InterfaceTerminal.text(), GuiText.InterfaceTerminalHint.text(),
btn -> selectNextInterfaceMode());
this.interfaceMode = new ToggleButton(this.x - 18, this.y + 26, 84, 85, GuiText.InterfaceTerminal.text(),
GuiText.InterfaceTerminalHint.text(), btn -> selectNextInterfaceMode());
this.addButton(this.interfaceMode);
}
@@ -27,20 +27,20 @@ import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import alexiil.mc.lib.attributes.Simulation;
import com.google.common.collect.HashMultimap;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.text.Text;
import alexiil.mc.lib.attributes.Simulation;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.client.ActionKey;
@@ -69,8 +69,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
private boolean refreshList = false;
private AETextField searchField;
public InterfaceTerminalScreen(InterfaceTerminalContainer container, PlayerInventory playerInventory,
Text title) {
public InterfaceTerminalScreen(InterfaceTerminalContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
final Scrollbar scrollbar = new Scrollbar();
this.setScrollBar(scrollbar);
@@ -142,7 +141,8 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/interfaceterminal.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
@@ -223,7 +223,8 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
for (int x = 0; x < current.getInventory().getSlotCount(); x++) {
final String which = Integer.toString(x);
if (invData.contains(which)) {
current.getInventory().setInvStack(x, ItemStack.fromTag(invData.getCompound(which)), Simulation.ACTION);
current.getInventory().setInvStack(x, ItemStack.fromTag(invData.getCompound(which)),
Simulation.ACTION);
}
}
} catch (final NumberFormatException ignored) {
@@ -68,12 +68,12 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
protected void addButtons() {
this.levelMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8, Settings.LEVEL_TYPE,
LevelType.ITEM_LEVEL);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28,
Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, Settings.REDSTONE_EMITTER,
RedstoneMode.LOW_SIGNAL);
this.fuzzyMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.craftingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48,
Settings.CRAFT_VIA_REDSTONE, YesNo.NO);
this.craftingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.CRAFT_VIA_REDSTONE,
YesNo.NO);
this.addButton(this.levelMode);
this.addButton(this.redstoneMode);
this.addButton(this.craftingMode);
@@ -100,14 +100,16 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
if (notCraftingMode) {
if (currentLevelMode == LevelType.ENERGY_LEVEL) {
this.textRenderer.draw(matrices, PowerUnits.AE.textComponent().getString(), 110, 44, COLOR_DARK_GRAY);
this.textRenderer.draw(matrices, PowerUnits.AE.textComponent().getString(), 110, 44,
COLOR_DARK_GRAY);
}
}
}
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
super.drawBG(matrices, offsetX, offsetY, mouseX, mouseY, partialTicks);
this.level.render(matrices, mouseX, mouseY, partialTicks);
}
@@ -20,13 +20,12 @@ package appeng.client.gui.implementations;
import java.util.List;
import appeng.mixins.SlotMixin;
import net.minecraft.client.util.math.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.slot.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
import appeng.api.config.SearchBoxMode;
@@ -63,6 +62,7 @@ import appeng.core.sync.packets.ConfigValuePacket;
import appeng.core.sync.packets.SwitchGuisPacket;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.integration.abstraction.ReiFacade;
import appeng.mixins.SlotMixin;
import appeng.parts.reporting.AbstractTerminalPart;
import appeng.tile.misc.SecurityStationBlockEntity;
import appeng.util.IConfigManagerHost;
@@ -205,13 +205,13 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
if (this.viewCell || this instanceof WirelessTermScreen) {
this.viewModeToggle = this.addButton(new SettingToggleButton<>(this.x - 18, offset,
Settings.VIEW_MODE, getSortDisplay(), this::toggleServerSetting));
this.viewModeToggle = this.addButton(new SettingToggleButton<>(this.x - 18, offset, Settings.VIEW_MODE,
getSortDisplay(), this::toggleServerSetting));
offset += 20;
}
this.addButton(this.sortDirToggle = new SettingToggleButton<>(this.x - 18, offset,
Settings.SORT_DIRECTION, getSortDir(), this::toggleServerSetting));
this.addButton(this.sortDirToggle = new SettingToggleButton<>(this.x - 18, offset, Settings.SORT_DIRECTION,
getSortDir(), this::toggleServerSetting));
offset += 20;
SearchBoxMode searchMode = AEConfig.instance().getTerminalSearchMode();
@@ -225,8 +225,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
this::toggleTerminalStyle));
}
this.searchField = new AETextField(this.textRenderer, this.x + Math.max(80, this.offsetX), this.y + 4, 90,
12);
this.searchField = new AETextField(this.textRenderer, this.x + Math.max(80, this.offsetX), this.y + 4, 90, 12);
this.searchField.setHasBorder(false);
this.searchField.setMaxLength(25);
this.searchField.setEditableColor(0xFFFFFF);
@@ -319,7 +318,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture(this.getBackground());
final int x_width = 197;
@@ -333,8 +333,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
drawTexture(matrices, offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18);
}
drawTexture(matrices, offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
99 + this.reservedSpace - this.lowerTextureOffset);
drawTexture(matrices, offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18,
x_width, 99 + this.reservedSpace - this.lowerTextureOffset);
if (this.viewCell) {
boolean update = false;
@@ -25,8 +25,7 @@ import appeng.container.implementations.MEPortableCellContainer;
public class MEPortableCellScreen extends MEMonitorableScreen<MEPortableCellContainer> {
public MEPortableCellScreen(MEPortableCellContainer container, PlayerInventory playerInventory,
Text title) {
public MEPortableCellScreen(MEPortableCellContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
}
@@ -52,8 +52,8 @@ public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssembl
@Override
protected void addButtons() {
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8,
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8, Settings.REDSTONE_CONTROLLED,
RedstoneMode.IGNORE);
addButton(this.redstoneMode);
}
@@ -64,7 +64,8 @@ public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssembl
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.pb.x = 148 + this.x;
this.pb.y = 48 + this.y;
super.drawBG(matrices, offsetX, offsetY, mouseX, mouseY, partialTicks);
@@ -25,11 +25,10 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.slot.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Text;
import appeng.api.config.SortDir;
import appeng.api.config.SortOrder;
import appeng.api.config.ViewItems;
@@ -50,8 +49,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
private final int rows = 4;
private int tooltip = -1;
public NetworkStatusScreen(NetworkStatusContainer container, PlayerInventory playerInventory,
Text title) {
public NetworkStatusScreen(NetworkStatusContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
final Scrollbar scrollbar = new Scrollbar();
@@ -106,17 +104,18 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
this.textRenderer.draw(matrices, GuiText.NetworkDetails.text(), 8, 6, 4210752);
this.textRenderer.draw(matrices,
GuiText.StoredPower.text() + ": " + Platform.formatPowerLong(handler.getCurrentPower(), false),
13, 16, 4210752);
GuiText.StoredPower.text() + ": " + Platform.formatPowerLong(handler.getCurrentPower(), false), 13, 16,
4210752);
this.textRenderer.draw(matrices,
GuiText.MaxPower.text() + ": " + Platform.formatPowerLong(handler.getMaxPower(), false), 13, 26,
4210752);
this.textRenderer.draw(matrices, GuiText.PowerInputRate.text() + ": "
+ Platform.formatPowerLong(handler.getAverageAddition(), true), 13, 143 - 10, 4210752);
this.textRenderer.draw(matrices,
GuiText.PowerUsageRate.text() + ": " + Platform.formatPowerLong(handler.getPowerUsage(), true),
13, 143 - 20, 4210752);
GuiText.PowerInputRate.text() + ": " + Platform.formatPowerLong(handler.getAverageAddition(), true), 13,
143 - 10, 4210752);
this.textRenderer.draw(matrices,
GuiText.PowerUsageRate.text() + ": " + Platform.formatPowerLong(handler.getPowerUsage(), true), 13,
143 - 20, 4210752);
final int sectionLength = 30;
@@ -143,8 +142,9 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
final int w = this.textRenderer.getWidth(str);
this.textRenderer.draw(matrices, str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * 18 + yo + 6) * 2, 4210752);
this.textRenderer.draw(matrices, str,
(int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2), (y * 18 + yo + 6) * 2,
4210752);
RenderSystem.popMatrix();
final int posX = x * sectionLength + xo + sectionLength - 18;
@@ -155,8 +155,8 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
toolTip.add(GuiText.Installed.withSuffix(": " + (refStack.getStackSize())));
if (refStack.getCountRequestable() > 0) {
toolTip.add(GuiText.EnergyDrain.withSuffix(": "
+ Platform.formatPowerLong(refStack.getCountRequestable(), true)));
toolTip.add(GuiText.EnergyDrain
.withSuffix(": " + Platform.formatPowerLong(refStack.getCountRequestable(), true)));
}
toolPosX = x * sectionLength + xo + sectionLength - 8;
@@ -180,7 +180,8 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/networkstatus.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -223,8 +224,8 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
currentToolTip.add(GuiText.Installed.withSuffix(": " + myStack.getStackSize()));
currentToolTip.add(GuiText.EnergyDrain.withSuffix(": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true)));
currentToolTip.add(GuiText.EnergyDrain
.withSuffix(": " + Platform.formatPowerLong(myStack.getCountRequestable(), true)));
this.drawTooltip(matrices, x, y, currentToolTip);
}
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.ToggleButton;
import appeng.container.implementations.NetworkToolContainer;
@@ -43,9 +42,8 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
public void init() {
super.init();
this.tFacades = new ToggleButton(this.x - 18, this.y + 8, 23, 22,
GuiText.TransparentFacades.text(), GuiText.TransparentFacadesHint.text(),
btn -> toggleFacades());
this.tFacades = new ToggleButton(this.x - 18, this.y + 8, 23, 22, GuiText.TransparentFacades.text(),
GuiText.TransparentFacadesHint.text(), btn -> toggleFacades());
this.addButton(this.tFacades);
}
@@ -65,7 +63,8 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/toolbox.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -6,14 +6,14 @@ import java.util.function.LongConsumer;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.NumberEntryType;
import appeng.client.gui.widgets.ITickingWidget;
import appeng.client.gui.widgets.NumberBox;
import appeng.core.AEConfig;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
/**
* A utility widget that consists of a text-field to enter a number with
@@ -88,17 +88,24 @@ public class NumberEntryWidget implements ITickingWidget {
int top = parent.getY() + y;
addButton.accept(this.plus1 = new ButtonWidget(left, top, 22, 20, new LiteralText("+" + a), btn -> addQty(a)));
addButton.accept(this.plus10 = new ButtonWidget(left + 28, top, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
addButton.accept(this.plus100 = new ButtonWidget(left + 62, top, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
addButton.accept(this.plus1000 = new ButtonWidget(left + 100, top, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
addButton.accept(
this.plus10 = new ButtonWidget(left + 28, top, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
addButton.accept(
this.plus100 = new ButtonWidget(left + 62, top, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
addButton.accept(
this.plus1000 = new ButtonWidget(left + 100, top, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
// Placing this here will give a sensible tab order
addChildren.accept(this.level);
addButton.accept(this.minus1 = new ButtonWidget(left, top + 42, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
addButton.accept(this.minus10 = new ButtonWidget(left + 28, top + 42, 28, 20, new LiteralText("-" + b), btn -> addQty(-b)));
addButton.accept(this.minus100 = new ButtonWidget(left + 62, top + 42, 32, 20, new LiteralText("-" + c), btn -> addQty(-c)));
addButton.accept(this.minus1000 = new ButtonWidget(left + 100, top + 42, 38, 20, new LiteralText("-" + d), btn -> addQty(-d)));
addButton.accept(
this.minus1 = new ButtonWidget(left, top + 42, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
addButton.accept(this.minus10 = new ButtonWidget(left + 28, top + 42, 28, 20, new LiteralText("-" + b),
btn -> addQty(-b)));
addButton.accept(this.minus100 = new ButtonWidget(left + 62, top + 42, 32, 20, new LiteralText("-" + c),
btn -> addQty(-c)));
addButton.accept(this.minus1000 = new ButtonWidget(left + 100, top + 42, 38, 20, new LiteralText("-" + d),
btn -> addQty(-d)));
}
private void addQty(final long i) {
@@ -18,7 +18,6 @@
package appeng.client.gui.implementations;
import appeng.mixins.SlotMixin;
import net.minecraft.block.Blocks;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
@@ -33,6 +32,7 @@ import appeng.container.slot.AppEngSlot;
import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket;
import appeng.mixins.SlotMixin;
public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer> {
@@ -126,8 +126,8 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
}
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
this.textRenderer.draw(matrices, GuiText.PatternTerminal.text(), 8, this.backgroundHeight - 96 + 2 - this.getReservedSpace(),
4210752);
this.textRenderer.draw(matrices, GuiText.PatternTerminal.text(), 8,
this.backgroundHeight - 96 + 2 - this.getReservedSpace(), 4210752);
}
@Override
@@ -66,7 +66,8 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture(getBackground());
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.container.implementations.QNBContainer;
import appeng.core.localization.GuiText;
@@ -41,7 +40,8 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/chest.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -18,16 +18,15 @@
package appeng.client.gui.implementations;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import appeng.client.ActionKey;
import appeng.client.gui.AEBaseScreen;
import appeng.container.implementations.QuartzKnifeContainer;
@@ -49,7 +48,8 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
public void init() {
super.init();
this.name = new TextFieldWidget(this.textRenderer, this.x + 24, this.y + 32, 79, this.textRenderer.fontHeight, LiteralText.EMPTY);
this.name = new TextFieldWidget(this.textRenderer, this.x + 24, this.y + 32, 79, this.textRenderer.fontHeight,
LiteralText.EMPTY);
this.name.setHasBorder(false);
this.name.setMaxLength(32);
this.name.setEditableColor(0xFFFFFF);
@@ -64,7 +64,8 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/quartzknife.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
this.name.render(matrices, mouseX, mouseY, partialTicks);
@@ -38,8 +38,7 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
private ToggleButton build;
private ToggleButton security;
public SecurityStationScreen(SecurityStationContainer container, PlayerInventory playerInventory,
Text title) {
public SecurityStationScreen(SecurityStationContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.setCustomSortOrder(false);
this.setReservedSpace(33);
@@ -59,9 +58,9 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
super.init();
final int top = this.y + this.backgroundHeight - 116;
this.inject = this.addButton(new ToggleButton(this.x + 56, top, 11 * 16, 12 * 16,
SecurityPermissions.INJECT.nameText(), SecurityPermissions.INJECT.tooltipText(),
btn -> toggleOption(SecurityPermissions.INJECT)));
this.inject = this
.addButton(new ToggleButton(this.x + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT.nameText(),
SecurityPermissions.INJECT.tooltipText(), btn -> toggleOption(SecurityPermissions.INJECT)));
this.extract = this.addButton(new ToggleButton(this.x + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1,
SecurityPermissions.EXTRACT.nameText(), SecurityPermissions.EXTRACT.tooltipText(),
@@ -83,8 +82,8 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
@Override
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
this.textRenderer.draw(matrices, GuiText.SecurityCardEditor.text(), 8, this.backgroundHeight - 96 + 1 - this.getReservedSpace(),
4210752);
this.textRenderer.draw(matrices, GuiText.SecurityCardEditor.text(), 8,
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
}
@Override
@@ -20,9 +20,8 @@ package appeng.client.gui.implementations;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.Identifier;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import appeng.client.gui.AEBaseScreen;
import appeng.container.implementations.SkyChestContainer;
@@ -45,7 +44,8 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
bindTexture(TEXTURE);
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.CommonButtons;
import appeng.container.implementations.SpatialIOPortContainer;
@@ -31,8 +30,7 @@ import appeng.util.Platform;
public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
public SpatialIOPortScreen(SpatialIOPortContainer container, PlayerInventory playerInventory,
Text title) {
public SpatialIOPortScreen(SpatialIOPortContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.backgroundHeight = 199;
}
@@ -45,13 +43,14 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
@Override
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.textRenderer.draw(matrices, GuiText.StoredPower.withSuffix(": "
+ Platform.formatPowerLong(this.handler.getCurrentPower(), false)), 13, 21, 4210752);
this.textRenderer.draw(matrices,
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getMaxPower(), false)), 13,
31, 4210752);
this.textRenderer.draw(matrices, GuiText.RequiredPower.withSuffix(": "
+ Platform.formatPowerLong(this.handler.getRequiredPower(), false)), 13, 73, 4210752);
GuiText.StoredPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getCurrentPower(), false)),
13, 21, 4210752);
this.textRenderer.draw(matrices,
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getMaxPower(), false)), 13, 31,
4210752);
this.textRenderer.draw(matrices, GuiText.RequiredPower
.withSuffix(": " + Platform.formatPowerLong(this.handler.getRequiredPower(), false)), 13, 73, 4210752);
this.textRenderer.draw(matrices,
GuiText.Efficiency.withSuffix(": " + (((float) this.handler.getEfficency()) / 100) + '%'), 13, 83,
4210752);
@@ -60,17 +59,19 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96, 4210752);
if (this.handler.xSize != 0 && this.handler.ySize != 0 && this.handler.zSize != 0) {
final Text text = GuiText.SCSSize.withSuffix(": " + this.handler.xSize + "x" + this.handler.ySize
+ "x" + this.handler.zSize);
final Text text = GuiText.SCSSize
.withSuffix(": " + this.handler.xSize + "x" + this.handler.ySize + "x" + this.handler.zSize);
this.textRenderer.draw(matrices, text, 13, 93, 4210752);
} else {
this.textRenderer.draw(matrices, GuiText.SCSSize.withSuffix(": ").append(GuiText.SCSInvalid.text()), 13, 93, 4210752);
this.textRenderer.draw(matrices, GuiText.SCSSize.withSuffix(": ").append(GuiText.SCSInvalid.text()), 13, 93,
4210752);
}
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/spatialio.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -54,13 +54,13 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
addButton(new ActionButton(this.x - 18, this.y + 28, ActionItems.WRENCH, btn -> partition()));
this.rwMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.ACCESS,
AccessRestriction.READ_WRITE);
this.storageFilter = new ServerSettingToggleButton<>(this.x - 18, this.y + 68,
Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY);
this.storageFilter = new ServerSettingToggleButton<>(this.x - 18, this.y + 68, Settings.STORAGE_FILTER,
StorageFilter.EXTRACTABLE_ONLY);
this.fuzzyMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 88, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(new TabButton(this.x + 154, this.y, 2 + 4 * 16, GuiText.Priority.text(), this.itemRenderer,
btn -> openPriorityGui()));
this.addButton(this.storageFilter);
this.addButton(this.fuzzyMode);
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
import appeng.api.config.SchedulingMode;
@@ -68,17 +67,16 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
protected void addButtons() {
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8,
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 8, Settings.REDSTONE_CONTROLLED,
RedstoneMode.IGNORE);
addButton(this.redstoneMode);
this.fuzzyMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
addButton(this.fuzzyMode);
this.craftMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.CRAFT_ONLY,
YesNo.NO);
this.craftMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, Settings.CRAFT_ONLY, YesNo.NO);
addButton(this.craftMode);
this.schedulingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 68,
Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT);
this.schedulingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 68, Settings.SCHEDULING_MODE,
SchedulingMode.DEFAULT);
addButton(this.schedulingMode);
}
@@ -105,7 +103,8 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.handleButtonVisibility();
this.bindTexture(this.getBackground());
@@ -114,7 +113,8 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
drawTexture(matrices, offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18);
}
if (this.hasToolbox()) {
drawTexture(matrices, offsetX + 178, offsetY + this.backgroundHeight - 90, 178, this.backgroundHeight - 90, 68, 68);
drawTexture(matrices, offsetX + 178, offsetY + this.backgroundHeight - 90, 178, this.backgroundHeight - 90,
68, 68);
}
}
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.ProgressBar;
import appeng.client.gui.widgets.ProgressBar.Direction;
@@ -37,8 +36,7 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
private ProgressBar pb;
public VibrationChamberScreen(VibrationChamberContainer container, PlayerInventory playerInventory,
Text title) {
public VibrationChamberScreen(VibrationChamberContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
this.backgroundHeight = 166;
}
@@ -56,8 +54,8 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.VibrationChamber.text()), 8, 6, 4210752);
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
this.pb.setFullMsg(new LiteralText(VibrationChamberBlockEntity.POWER_PER_TICK * this.handler.getCurrentProgress()
/ VibrationChamberBlockEntity.DILATION_SCALING + " AE/t"));
this.pb.setFullMsg(new LiteralText(VibrationChamberBlockEntity.POWER_PER_TICK
* this.handler.getCurrentProgress() / VibrationChamberBlockEntity.DILATION_SCALING + " AE/t"));
if (this.handler.getRemainingBurnTime() > 0) {
final int i1 = this.handler.getRemainingBurnTime() * 12 / 100;
@@ -70,7 +68,8 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/vibchamber.png");
this.pb.x = 99 + this.x;
this.pb.y = 36 + this.y;
@@ -22,7 +22,6 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.CommonButtons;
import appeng.container.implementations.WirelessContainer;
@@ -62,7 +61,8 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
}
@Override
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
public void drawBG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY,
float partialTicks) {
this.bindTexture("guis/wireless.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
}
@@ -26,8 +26,7 @@ import appeng.container.implementations.MEPortableCellContainer;
// FIXME: Extended from GuiPortableCell before... Why?
public class WirelessTermScreen extends MEMonitorableScreen<MEPortableCellContainer> {
public WirelessTermScreen(MEPortableCellContainer container, PlayerInventory playerInventory,
Text title) {
public WirelessTermScreen(MEPortableCellContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title);
}
@@ -53,7 +53,7 @@ public class AETextField extends TextFieldWidget {
* @param height absolute height
*/
public AETextField(final TextRenderer fontRenderer, final int xPos, final int yPos, final int width,
final int height) {
final int height) {
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getWidth("_"),
height - 2 * PADDING, LiteralText.EMPTY);
@@ -87,11 +87,13 @@ public class AETextField extends TextFieldWidget {
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float partial) {
if (this.isVisible()) {
if (this.isFocused()) {
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
this.y + this.height + PADDING - 1, 0xFF606060);
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1,
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
0xFF606060);
} else {
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
this.y + this.height + PADDING - 1, 0xFFA8A8A8);
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1,
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
0xFFA8A8A8);
}
super.renderButton(matrices, mouseX, mouseY, partial);
}
@@ -21,11 +21,12 @@ package appeng.client.gui.widgets;
import java.util.function.Consumer;
import java.util.regex.Pattern;
import appeng.api.config.ActionItems;
import appeng.core.localization.ButtonToolTips;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import appeng.api.config.ActionItems;
import appeng.core.localization.ButtonToolTips;
public class ActionButton extends IconButton implements ITooltip {
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
private final int iconIndex;
@@ -30,7 +30,8 @@ public abstract class CustomSlotWidget extends DrawableHelper implements IToolti
public void slotClicked(final ItemStack clickStack, final int mouseButton) {
}
public abstract void drawContent(final MinecraftClient mc, final int mouseX, final int mouseY, final float partialTicks);
public abstract void drawContent(final MinecraftClient mc, final int mouseX, final int mouseY,
final float partialTicks);
public void drawBackground(MatrixStack matrices, int guileft, int guitop, int currentZIndex) {
}
@@ -28,8 +28,7 @@ import net.minecraft.text.LiteralText;
import net.minecraft.util.Identifier;
public abstract class IconButton extends ButtonWidget implements ITooltip {
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
"textures/guis/states.png");
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
private boolean halfSize = false;
@@ -35,7 +35,7 @@ public class NumberBox extends TextFieldWidget {
private long maxValue;
public NumberBox(final TextRenderer fontRenderer, final int x, final int y, final int width, final int height,
final Class<?> type, LongConsumer changeListener) {
final Class<?> type, LongConsumer changeListener) {
super(fontRenderer, x, y, width, height, new LiteralText("0"));
this.setText("0");
setChangedListener(this::handleTextChanged);
@@ -18,8 +18,6 @@
package appeng.client.gui.widgets;
import appeng.container.interfaces.IProgressProvider;
import appeng.core.localization.GuiText;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
@@ -27,6 +25,9 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import appeng.container.interfaces.IProgressProvider;
import appeng.core.localization.GuiText;
public class ProgressBar extends AbstractButtonWidget implements ITooltip {
private final IProgressProvider source;
@@ -66,8 +67,7 @@ public class ProgressBar extends AbstractButtonWidget implements ITooltip {
this.height - diff);
} else {
final int diff = this.width - (max > 0 ? (this.width * current) / max : 0);
drawTexture(matrices, this.x, this.y, this.fill_u + diff, this.fill_v, this.width - diff,
this.height);
drawTexture(matrices, this.x, this.y, this.fill_u + diff, this.fill_v, this.width - diff, this.height);
}
}
}
@@ -83,8 +83,7 @@ public class ProgressBar extends AbstractButtonWidget implements ITooltip {
}
Text text = this.titleName != null ? this.titleName : LiteralText.EMPTY;
return text.copy().append("\n" + this.source.getCurrentProgress() + " ")
.append(GuiText.Of.text())
return text.copy().append("\n" + this.source.getCurrentProgress() + " ").append(GuiText.Of.text())
.append(" " + this.source.getMaxProgress());
}
@@ -20,10 +20,11 @@ package appeng.client.gui.widgets;
import com.mojang.blaze3d.systems.RenderSystem;
import appeng.client.gui.AEBaseScreen;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.util.math.MatrixStack;
import appeng.client.gui.AEBaseScreen;
public class Scrollbar implements IScrollSource {
private int displayX = 0;
@@ -36,7 +37,8 @@ public class Scrollbar implements IScrollSource {
private int minScroll = 0;
private int currentScroll = 0;
private final DrawableHelper drawable = new DrawableHelper(){};
private final DrawableHelper drawable = new DrawableHelper() {
};
public void draw(MatrixStack matrices, final AEBaseScreen<?> g) {
g.bindTexture("minecraft", "gui/container/creative_inventory/tabs.png");
@@ -29,15 +29,14 @@ import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
public class TabButton extends ButtonWidget implements ITooltip {
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
"textures/guis/states.png");
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
private final ItemRenderer itemRenderer;
private int hideEdge = 0;
private int myIcon = -1;
private ItemStack myItem;
public TabButton(final int x, final int y, final int ico, final Text message, final ItemRenderer ir,
PressAction onPress) {
PressAction onPress) {
super(x, y, 22, 22, message, onPress);
this.myIcon = ico;
@@ -30,8 +30,7 @@ import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
public class ToggleButton extends ButtonWidget implements ITooltip {
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
"textures/guis/states.png");
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
private final int iconIdxOn;
private final int iconIdxOff;