The Great Renamening of 2020
This commit is contained in:
@@ -43,7 +43,7 @@ import appeng.client.render.effects.*;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.helpers.IMouseWheelItem;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.util.Platform;
|
||||
@@ -222,7 +222,7 @@ public class ClientHelper extends ServerHelper {
|
||||
|
||||
if (mainHand || offHand) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketValueConfig("Item", me.getScrollDelta() > 0 ? "WheelUp" : "WheelDown"));
|
||||
.sendToServer(new ConfigValuePacket("Item", me.getScrollDelta() > 0 ? "WheelUp" : "WheelDown"));
|
||||
me.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ import appeng.container.AEBaseContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public abstract class AEBaseMEGui<T extends AEBaseContainer> extends AEBaseGui<T> {
|
||||
public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseScreen<T> {
|
||||
|
||||
public AEBaseMEGui(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseMEScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+41
-41
@@ -59,8 +59,8 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiCustomSlot;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.CustomSlotWidget;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
@@ -71,36 +71,36 @@ import appeng.container.slot.AppEngCraftingSlot;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.AppEngSlot.CalculatedValidity;
|
||||
import appeng.container.slot.IOptionalSlot;
|
||||
import appeng.container.slot.SlotCraftingTerm;
|
||||
import appeng.container.slot.SlotDisabled;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.container.slot.SlotInaccessible;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.container.slot.CraftingTermSlot;
|
||||
import appeng.container.slot.DisabledSlot;
|
||||
import appeng.container.slot.FakeSlot;
|
||||
import appeng.container.slot.InaccessibleSlot;
|
||||
import appeng.container.slot.OutputSlot;
|
||||
import appeng.container.slot.PatternTermSlot;
|
||||
import appeng.container.slot.RestrictedInputSlot;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.core.sync.packets.InventoryActionPacket;
|
||||
import appeng.core.sync.packets.SwapSlotsPacket;
|
||||
import appeng.fluids.client.render.FluidStackSizeRenderer;
|
||||
import appeng.fluids.container.slots.IMEFluidSlot;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScreen<T> {
|
||||
public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerScreen<T> {
|
||||
private final List<InternalSlotME> meSlots = new ArrayList<>();
|
||||
// drag y
|
||||
private final Set<Slot> drag_click = new HashSet<>();
|
||||
private final StackSizeRenderer stackSizeRenderer = new StackSizeRenderer();
|
||||
private final FluidStackSizeRenderer fluidStackSizeRenderer = new FluidStackSizeRenderer();
|
||||
private GuiScrollbar myScrollBar = null;
|
||||
private Scrollbar myScrollBar = null;
|
||||
private boolean disableShiftClick = false;
|
||||
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
||||
private ItemStack dbl_whichItem = ItemStack.EMPTY;
|
||||
private Slot bl_clicked;
|
||||
protected final List<GuiCustomSlot> guiSlots = new ArrayList<>();
|
||||
protected final List<CustomSlotWidget> guiSlots = new ArrayList<>();
|
||||
|
||||
public AEBaseGui(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@@ -128,11 +128,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translatef(this.guiLeft, this.guiTop, 0.0F);
|
||||
RenderSystem.enableDepthTest();
|
||||
for (final GuiCustomSlot c : this.guiSlots) {
|
||||
for (final CustomSlotWidget c : this.guiSlots) {
|
||||
this.drawGuiSlot(c, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
RenderSystem.disableDepthTest();
|
||||
for (final GuiCustomSlot c : this.guiSlots) {
|
||||
for (final CustomSlotWidget c : this.guiSlots) {
|
||||
this.drawTooltip(c, mouseX - this.guiLeft, mouseY - this.guiTop);
|
||||
}
|
||||
RenderSystem.popMatrix();
|
||||
@@ -147,7 +147,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiSlot(GuiCustomSlot slot, int mouseX, int mouseY, float partialTicks) {
|
||||
protected void drawGuiSlot(CustomSlotWidget slot, int mouseX, int mouseY, float partialTicks) {
|
||||
if (slot.isSlotEnabled()) {
|
||||
final int left = slot.xPos();
|
||||
final int top = slot.yPos();
|
||||
@@ -250,7 +250,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
for (final GuiCustomSlot slot : this.guiSlots) {
|
||||
for (final CustomSlotWidget slot : this.guiSlots) {
|
||||
slot.drawBackground(ox, oy, getBlitOffset());
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
for (GuiCustomSlot slot : this.guiSlots) {
|
||||
for (CustomSlotWidget slot : this.guiSlots) {
|
||||
if (this.isPointInRegion(slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord)
|
||||
&& slot.canClick(getPlayer())) {
|
||||
slot.slotClicked(getPlayer().inventory.getItemStack(), btn);
|
||||
@@ -294,11 +294,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
this.getScrollBar().click((int) mouseX - this.guiLeft, (int) mouseY - this.guiTop);
|
||||
}
|
||||
|
||||
if (slot instanceof SlotFake && !itemstack.isEmpty()) {
|
||||
if (slot instanceof FakeSlot && !itemstack.isEmpty()) {
|
||||
this.drag_click.add(slot);
|
||||
if (this.drag_click.size() > 1) {
|
||||
for (final Slot dr : this.drag_click) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(
|
||||
final InventoryActionPacket p = new InventoryActionPacket(
|
||||
mouseButton == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
|
||||
dr.slotNumber, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
@@ -317,7 +317,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
final ClickType clickType) {
|
||||
final PlayerEntity player = getPlayer();
|
||||
|
||||
if (slot instanceof SlotFake) {
|
||||
if (slot instanceof FakeSlot) {
|
||||
final InventoryAction action = mouseButton == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE
|
||||
: InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
|
||||
@@ -325,19 +325,19 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
return;
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slotIdx, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slotIdx, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (slot instanceof SlotPatternTerm) {
|
||||
if (slot instanceof PatternTermSlot) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(((SlotPatternTerm) slot).getRequest(hasShiftDown()));
|
||||
} else if (slot instanceof SlotCraftingTerm) {
|
||||
NetworkHandler.instance().sendToServer(((PatternTermSlot) slot).getRequest(hasShiftDown()));
|
||||
} else if (slot instanceof CraftingTermSlot) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
@@ -350,7 +350,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slotIdx, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slotIdx, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
|
||||
return;
|
||||
@@ -370,7 +370,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
|
||||
((AEBaseContainer) this.container).setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, slotNum, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(InventoryAction.MOVE_REGION, slotNum, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
return;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
|
||||
if (action != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slot.getSlotIndex(),
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slot.getSlotIndex(),
|
||||
((SlotDisconnected) slot).getSlot().getId());
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
@@ -449,7 +449,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
|
||||
if (action != null) {
|
||||
this.container.setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, this.getInventorySlots().size(), 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, this.getInventorySlots().size(), 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
if (s.getSlotIndex() == j
|
||||
&& s.inventory == ((AEBaseContainer) this.container).getPlayerInv()) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketSwapSlots(s.slotNumber, theSlot.slotNumber));
|
||||
.sendToServer(new SwapSlotsPacket(s.slotNumber, theSlot.slotNumber));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -575,7 +575,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
final int times = (int) Math.abs(wheel);
|
||||
final int inventorySize = this.getInventorySlots().size();
|
||||
for (int h = 0; h < times; h++) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(direction, inventorySize, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(direction, inventorySize, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
}
|
||||
@@ -716,13 +716,13 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
if (!is.isEmpty() && s instanceof AppEngSlot) {
|
||||
AppEngSlot aeSlot = (AppEngSlot) s;
|
||||
if (aeSlot.getIsValid() == CalculatedValidity.NotAvailable) {
|
||||
boolean isValid = s.isItemValid(is) || s instanceof SlotOutput
|
||||
|| s instanceof AppEngCraftingSlot || s instanceof SlotDisabled
|
||||
|| s instanceof SlotInaccessible || s instanceof SlotFake
|
||||
|| s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
||||
if (isValid && s instanceof SlotRestrictedInput) {
|
||||
boolean isValid = s.isItemValid(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 {
|
||||
isValid = ((SlotRestrictedInput) s).isValid(is, getMinecraft().world);
|
||||
isValid = ((RestrictedInputSlot) s).isValid(is, getMinecraft().world);
|
||||
} catch (final Exception err) {
|
||||
AELog.debug(err);
|
||||
}
|
||||
@@ -770,11 +770,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
getMinecraft().getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
protected GuiScrollbar getScrollBar() {
|
||||
protected Scrollbar getScrollBar() {
|
||||
return this.myScrollBar;
|
||||
}
|
||||
|
||||
protected void setScrollBar(final GuiScrollbar myScrollBar) {
|
||||
protected void setScrollBar(final Scrollbar myScrollBar) {
|
||||
this.myScrollBar = myScrollBar;
|
||||
}
|
||||
|
||||
+28
-28
@@ -11,29 +11,29 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerWirelessTerm;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.ChestContainer;
|
||||
import appeng.container.implementations.CraftingTermContainer;
|
||||
import appeng.container.implementations.MEMonitorableContainer;
|
||||
import appeng.container.implementations.PatternTermContainer;
|
||||
import appeng.container.implementations.WirelessTermContainer;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.parts.reporting.PartCraftingTerminal;
|
||||
import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.parts.reporting.PartTerminal;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.parts.reporting.CraftingTerminalPart;
|
||||
import appeng.parts.reporting.PatternTerminalPart;
|
||||
import appeng.parts.reporting.TerminalPart;
|
||||
import appeng.tile.storage.ChestTileEntity;
|
||||
|
||||
/**
|
||||
* Utility class for sub-screens of other containers that allow returning to the
|
||||
* primary container UI.
|
||||
*/
|
||||
final class AESubGui {
|
||||
final class AESubScreen {
|
||||
|
||||
private final AEBaseGui<?> gui;
|
||||
private final AEBaseScreen<?> gui;
|
||||
private final ContainerType<?> previousContainerType;
|
||||
private final ItemStack previousContainerIcon;
|
||||
|
||||
@@ -41,19 +41,19 @@ final class AESubGui {
|
||||
* Based on the container we're opening for, try to determine what it's
|
||||
* "primary" GUI would be so that we can go back to it.
|
||||
*/
|
||||
public AESubGui(AEBaseGui<?> gui, Object containerTarget) {
|
||||
public AESubScreen(AEBaseScreen<?> gui, Object containerTarget) {
|
||||
this.gui = gui;
|
||||
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (containerTarget instanceof TileChest) {
|
||||
if (containerTarget instanceof ChestTileEntity) {
|
||||
// A chest is also a priority host, but the priority _interface_ can only be
|
||||
// opened from the
|
||||
// chest ui that doesn't actually show the contents of the inserted cell.
|
||||
IPriorityHost priorityHost = (IPriorityHost) containerTarget;
|
||||
this.previousContainerIcon = priorityHost.getItemStackRepresentation();
|
||||
this.previousContainerType = ContainerChest.TYPE;
|
||||
this.previousContainerType = ChestContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof IPriorityHost) {
|
||||
@@ -64,22 +64,22 @@ final class AESubGui {
|
||||
|
||||
else if (containerTarget instanceof WirelessTerminalGuiObject) {
|
||||
this.previousContainerIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerWirelessTerm.TYPE;
|
||||
this.previousContainerType = WirelessTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartTerminal) {
|
||||
else if (containerTarget instanceof TerminalPart) {
|
||||
this.previousContainerIcon = parts.terminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerMEMonitorable.TYPE;
|
||||
this.previousContainerType = MEMonitorableContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartCraftingTerminal) {
|
||||
else if (containerTarget instanceof CraftingTerminalPart) {
|
||||
this.previousContainerIcon = parts.craftingTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerCraftingTerm.TYPE;
|
||||
this.previousContainerType = CraftingTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartPatternTerminal) {
|
||||
else if (containerTarget instanceof PatternTerminalPart) {
|
||||
this.previousContainerIcon = parts.patternTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerPatternTerm.TYPE;
|
||||
this.previousContainerType = PatternTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -88,17 +88,17 @@ final class AESubGui {
|
||||
}
|
||||
}
|
||||
|
||||
public final GuiTabButton addBackButton(Consumer<GuiTabButton> buttonAdder, int x, int y) {
|
||||
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y) {
|
||||
return addBackButton(buttonAdder, x, y, null);
|
||||
}
|
||||
|
||||
public final GuiTabButton addBackButton(Consumer<GuiTabButton> buttonAdder, int x, int y, @Nullable String label) {
|
||||
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y, @Nullable String label) {
|
||||
if (this.previousContainerType != null && !previousContainerIcon.isEmpty()) {
|
||||
if (label == null) {
|
||||
label = previousContainerIcon.getDisplayName().getString();
|
||||
}
|
||||
ItemRenderer itemRenderer = gui.getMinecraft().getItemRenderer();
|
||||
GuiTabButton button = new GuiTabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon,
|
||||
TabButton button = new TabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon,
|
||||
label, itemRenderer, btn -> goBack());
|
||||
buttonAdder.accept(button);
|
||||
return button;
|
||||
@@ -107,7 +107,7 @@ final class AESubGui {
|
||||
}
|
||||
|
||||
public final void goBack() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(this.previousContainerType));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(this.previousContainerType));
|
||||
}
|
||||
|
||||
}
|
||||
+15
-15
@@ -30,32 +30,32 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.CellWorkbenchContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench> {
|
||||
public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContainer> {
|
||||
|
||||
private GuiToggleButton copyMode;
|
||||
private ToggleButton copyMode;
|
||||
|
||||
public GuiCellWorkbench(ContainerCellWorkbench container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.fuzzyMode = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.fuzzyMode = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL, this::toggleFuzzyMode));
|
||||
this.addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH,
|
||||
this.addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH,
|
||||
act1 -> action("Partition")));
|
||||
this.addButton(
|
||||
new GuiActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, act -> action("Clear")));
|
||||
this.copyMode = this.addButton(new GuiToggleButton(this.guiLeft - 18, this.guiTop + 48, 11 * 16 + 5,
|
||||
new ActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, act -> action("Clear")));
|
||||
this.copyMode = this.addButton(new ToggleButton(this.guiLeft - 18, this.guiTop + 48, 11 * 16 + 5,
|
||||
12 * 16 + 5, GuiText.CopyMode.getLocal(), GuiText.CopyModeDesc.getLocal(), act -> action("CopyMode")));
|
||||
}
|
||||
|
||||
@@ -146,12 +146,12 @@ public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench> {
|
||||
}
|
||||
|
||||
private void action(String type) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("CellWorkbench.Action", type));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("CellWorkbench.Action", type));
|
||||
}
|
||||
|
||||
private void toggleFuzzyMode(GuiSettingToggleButton<FuzzyMode> button, boolean backwards) {
|
||||
private void toggleFuzzyMode(SettingToggleButton<FuzzyMode> button, boolean backwards) {
|
||||
FuzzyMode fz = button.getNextValue(backwards);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("CellWorkbench.Fuzzy", fz.name()));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("CellWorkbench.Fuzzy", fz.name()));
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.ChestContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiChest extends AEBaseGui<ContainerChest> {
|
||||
public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
||||
|
||||
public GuiChest(ContainerChest container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -41,12 +41,12 @@ public class GuiChest extends AEBaseGui<ContainerChest> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriority()));
|
||||
}
|
||||
|
||||
private void openPriority() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
+11
-11
@@ -24,19 +24,19 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerCondenser;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.CondenserContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiCondenser extends AEBaseGui<ContainerCondenser> {
|
||||
public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
|
||||
|
||||
private GuiSettingToggleButton<CondenserOutput> mode;
|
||||
private SettingToggleButton<CondenserOutput> mode;
|
||||
|
||||
public GuiCondenser(ContainerCondenser container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
@@ -45,10 +45,10 @@ public class GuiCondenser extends AEBaseGui<ContainerCondenser> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.mode = new GuiServerSettingToggleButton<>(128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT,
|
||||
this.mode = new ServerSettingToggleButton<>(128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT,
|
||||
this.container.getOutput());
|
||||
|
||||
this.addButton(new GuiProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop,
|
||||
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop,
|
||||
178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal()));
|
||||
this.addButton(this.mode);
|
||||
}
|
||||
+11
-11
@@ -24,24 +24,24 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.container.implementations.CraftAmountContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketCraftRequest;
|
||||
import appeng.core.sync.packets.CraftRequestPacket;
|
||||
|
||||
public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
private final AESubGui subGui;
|
||||
public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private GuiNumberBox amountToCraft;
|
||||
private NumberBox amountToCraft;
|
||||
|
||||
private Button next;
|
||||
|
||||
public GuiCraftAmount(ContainerCraftAmount container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
|
||||
subGui.addBackButton(this::addButton, 154, 0);
|
||||
|
||||
this.amountToCraft = new GuiNumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
this.amountToCraft = new NumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
Integer.class);
|
||||
this.amountToCraft.setEnableBackgroundDrawing(false);
|
||||
this.amountToCraft.setMaxStringLength(16);
|
||||
@@ -80,7 +80,7 @@ public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
|
||||
private void confirm(Button button) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketCraftRequest(Integer.parseInt(this.amountToCraft.getText()), hasShiftDown()));
|
||||
.sendToServer(new CraftRequestPacket(Integer.parseInt(this.amountToCraft.getText()), hasShiftDown()));
|
||||
}
|
||||
|
||||
@Override
|
||||
+11
-11
@@ -37,17 +37,17 @@ import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.container.implementations.CraftConfirmContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private final int rows = 5;
|
||||
|
||||
@@ -64,13 +64,13 @@ public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
private Button selectCPU;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftConfirm(ContainerCraftConfirm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
this.xSize = 238;
|
||||
this.ySize = 206;
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
}
|
||||
|
||||
@@ -450,11 +450,11 @@ public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
private void start() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Start", "Start"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Start", "Start"));
|
||||
}
|
||||
|
||||
}
|
||||
+8
-8
@@ -42,18 +42,18 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.container.implementations.CraftingCPUContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T> implements ISortSource {
|
||||
public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScreen<T> implements ISortSource {
|
||||
private static final int GUI_HEIGHT = 184;
|
||||
private static final int GUI_WIDTH = 238;
|
||||
|
||||
@@ -90,12 +90,12 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
|
||||
private Button cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftingCPU(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingCPUScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
private void cancel() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("TileCrafting.Cancel", "Cancel"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("TileCrafting.Cancel", "Cancel"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+7
-7
@@ -26,20 +26,20 @@ import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.CraftingStatusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU<ContainerCraftingStatus> {
|
||||
public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private Button selectCPU;
|
||||
|
||||
public GuiCraftingStatus(ContainerCraftingStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingStatusScreen(CraftingStatusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU<ContainerCraftingStatus> {
|
||||
// FIXME: Extract to separate class? Shared with GuiCraftConfirm
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -23,17 +23,17 @@ import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.container.implementations.CraftingTermContainer;
|
||||
import appeng.container.slot.CraftingMatrixSlot;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.InventoryActionPacket;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContainer> {
|
||||
|
||||
public GuiCraftingTerm(ContainerCraftingTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingTermScreen(CraftingTermContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace(73);
|
||||
}
|
||||
@@ -41,13 +41,13 @@ public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
private void clear() {
|
||||
Slot s = null;
|
||||
for (final Object j : this.container.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
if (j instanceof CraftingMatrixSlot) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
GuiActionButton clearBtn = this.addButton(new GuiActionButton(this.guiLeft + 92, this.guiTop + this.ySize - 156,
|
||||
ActionButton clearBtn = this.addButton(new ActionButton(this.guiLeft + 92, this.guiTop + this.ySize - 156,
|
||||
ActionItems.STASH, btn -> clear()));
|
||||
clearBtn.setHalfSize(true);
|
||||
}
|
||||
+9
-9
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerDrive;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.DriveContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiDrive extends AEBaseGui<ContainerDrive> {
|
||||
public class DriveScreen extends AEBaseScreen<DriveContainer> {
|
||||
|
||||
public GuiDrive(ContainerDrive container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public DriveScreen(DriveContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
}
|
||||
@@ -41,12 +41,12 @@ public class GuiDrive extends AEBaseGui<ContainerDrive> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
+14
-14
@@ -24,32 +24,32 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerFormationPlane;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.FormationPlaneContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContainer> {
|
||||
|
||||
private GuiSettingToggleButton<YesNo> placeMode;
|
||||
private SettingToggleButton<YesNo> placeMode;
|
||||
|
||||
public GuiFormationPlane(ContainerFormationPlane container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public FormationPlaneScreen(FormationPlaneContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.placeMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK,
|
||||
this.placeMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK,
|
||||
YesNo.YES);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.placeMode);
|
||||
@@ -66,7 +66,7 @@ public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
}
|
||||
|
||||
if (this.placeMode != null) {
|
||||
this.placeMode.set(((ContainerFormationPlane) this.cvb).getPlaceMode());
|
||||
this.placeMode.set(((FormationPlaneContainer) this.cvb).getPlaceMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -22,13 +22,13 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerGrinder;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.GrinderContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiGrinder extends AEBaseGui<ContainerGrinder> {
|
||||
public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
|
||||
|
||||
public GuiGrinder(ContainerGrinder container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public GrinderScreen(GrinderContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
}
|
||||
+12
-12
@@ -27,31 +27,31 @@ import appeng.api.config.OperationMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerIOPort;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.IOPortContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiIOPort extends GuiUpgradeable<ContainerIOPort> {
|
||||
public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
|
||||
|
||||
private GuiSettingToggleButton<FullnessMode> fullMode;
|
||||
private GuiSettingToggleButton<OperationMode> operationMode;
|
||||
private SettingToggleButton<FullnessMode> fullMode;
|
||||
private SettingToggleButton<OperationMode> operationMode;
|
||||
|
||||
public GuiIOPort(ContainerIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public IOPortScreen(IOPortContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.fullMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE,
|
||||
this.fullMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE,
|
||||
FullnessMode.EMPTY);
|
||||
this.operationMode = new GuiServerSettingToggleButton<>(this.guiLeft + 80, this.guiTop + 17,
|
||||
this.operationMode = new ServerSettingToggleButton<>(this.guiLeft + 80, this.guiTop + 17,
|
||||
Settings.OPERATION_MODE, OperationMode.EMPTY);
|
||||
|
||||
this.addButton(this.operationMode);
|
||||
this.addButton(this.fullMode);
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
}
|
||||
@@ -66,11 +66,11 @@ public class GuiIOPort extends GuiUpgradeable<ContainerIOPort> {
|
||||
}
|
||||
|
||||
if (this.operationMode != null) {
|
||||
this.operationMode.set(((ContainerIOPort) this.cvb).getOperationMode());
|
||||
this.operationMode.set(((IOPortContainer) this.cvb).getOperationMode());
|
||||
}
|
||||
|
||||
if (this.fullMode != null) {
|
||||
this.fullMode.set(((ContainerIOPort) this.cvb).getFullMode());
|
||||
this.fullMode.set(((IOPortContainer) this.cvb).getFullMode());
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.container.implementations.InscriberContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiInscriber extends AEBaseGui<ContainerInscriber> {
|
||||
public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiInscriber(ContainerInscriber container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public InscriberScreen(InscriberContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
@@ -46,7 +46,7 @@ public class GuiInscriber extends AEBaseGui<ContainerInscriber> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/inscriber.png", 135, 39, 135, 177, 6, 18,
|
||||
this.pb = new ProgressBar(this.container, "guis/inscriber.png", 135, 39, 135, 177, 6, 18,
|
||||
Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
+19
-19
@@ -23,37 +23,37 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.InterfaceContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.ConfigButtonPacket;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
||||
|
||||
private GuiSettingToggleButton<YesNo> blockMode;
|
||||
private GuiToggleButton interfaceMode;
|
||||
private SettingToggleButton<YesNo> blockMode;
|
||||
private ToggleButton interfaceMode;
|
||||
|
||||
public GuiInterface(ContainerInterface container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public InterfaceScreen(InterfaceContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 211;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.blockMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK,
|
||||
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK,
|
||||
YesNo.NO);
|
||||
this.addButton(this.blockMode);
|
||||
|
||||
this.interfaceMode = new GuiToggleButton(this.guiLeft - 18, this.guiTop + 26, 84, 85,
|
||||
this.interfaceMode = new ToggleButton(this.guiLeft - 18, this.guiTop + 26, 84, 85,
|
||||
GuiText.InterfaceTerminal.getLocal(), GuiText.InterfaceTerminalHint.getLocal(),
|
||||
btn -> selectNextInterfaceMode());
|
||||
this.addButton(this.interfaceMode);
|
||||
@@ -62,11 +62,11 @@ public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
if (this.blockMode != null) {
|
||||
this.blockMode.set(((ContainerInterface) this.cvb).getBlockingMode());
|
||||
this.blockMode.set(((InterfaceContainer) this.cvb).getBlockingMode());
|
||||
}
|
||||
|
||||
if (this.interfaceMode != null) {
|
||||
this.interfaceMode.setState(((ContainerInterface) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||
}
|
||||
|
||||
this.font.drawString(this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, 4210752);
|
||||
@@ -84,12 +84,12 @@ public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
private void selectNextInterfaceMode() {
|
||||
final boolean backwards = getMinecraft().mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketConfigButton(Settings.INTERFACE_TERMINAL, backwards));
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(Settings.INTERFACE_TERMINAL, backwards));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-10
@@ -43,17 +43,17 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.AETextField;
|
||||
import appeng.client.me.ClientDCInternalInv;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
import appeng.container.implementations.ContainerInterfaceTerminal;
|
||||
import appeng.container.implementations.InterfaceTerminalContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal> {
|
||||
public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalContainer> {
|
||||
|
||||
private static final int LINES_ON_PAGE = 6;
|
||||
|
||||
@@ -65,12 +65,12 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
|
||||
private final Map<String, Set<Object>> cachedSearches = new WeakHashMap<>();
|
||||
|
||||
private boolean refreshList = false;
|
||||
private MEGuiTextField searchField;
|
||||
private AETextField searchField;
|
||||
|
||||
public GuiInterfaceTerminal(ContainerInterfaceTerminal container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public InterfaceTerminalScreen(InterfaceTerminalContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
this.xSize = 195;
|
||||
this.ySize = 222;
|
||||
@@ -84,7 +84,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
|
||||
this.getScrollBar().setHeight(106);
|
||||
this.getScrollBar().setTop(18);
|
||||
|
||||
this.searchField = new MEGuiTextField(this.font, this.guiLeft + 104, this.guiTop + 4, 65, 12);
|
||||
this.searchField = new AETextField(this.font, this.guiLeft + 104, this.guiTop + 4, 65, 12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField.setMaxStringLength(25);
|
||||
this.searchField.setTextColor(0xFFFFFF);
|
||||
+18
-18
@@ -29,18 +29,18 @@ import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.LevelEmitterContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer> {
|
||||
|
||||
private GuiNumberBox level;
|
||||
private NumberBox level;
|
||||
|
||||
private Button plus1;
|
||||
private Button plus10;
|
||||
@@ -51,10 +51,10 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
private Button minus100;
|
||||
private Button minus1000;
|
||||
|
||||
private GuiSettingToggleButton<LevelType> levelMode;
|
||||
private GuiSettingToggleButton<YesNo> craftingMode;
|
||||
private SettingToggleButton<LevelType> levelMode;
|
||||
private SettingToggleButton<YesNo> craftingMode;
|
||||
|
||||
public GuiLevelEmitter(ContainerLevelEmitter container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public LevelEmitterScreen(LevelEmitterContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.level = new GuiNumberBox(this.font, this.guiLeft + 24, this.guiTop + 43, 79, this.font.FONT_HEIGHT,
|
||||
this.level = new NumberBox(this.font, this.guiLeft + 24, this.guiTop + 43, 79, this.font.FONT_HEIGHT,
|
||||
Long.class);
|
||||
this.level.setEnableBackgroundDrawing(false);
|
||||
this.level.setMaxStringLength(16);
|
||||
@@ -74,13 +74,13 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.levelMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE,
|
||||
this.levelMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE,
|
||||
LevelType.ITEM_LEVEL);
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
this.craftingMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48,
|
||||
this.craftingMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48,
|
||||
Settings.CRAFT_VIA_REDSTONE, YesNo.NO);
|
||||
|
||||
final int a = AEConfig.instance().levelByStackAmounts(0);
|
||||
@@ -134,7 +134,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
}
|
||||
|
||||
if (this.levelMode != null) {
|
||||
this.levelMode.set(((ContainerLevelEmitter) this.cvb).getLevelMode());
|
||||
this.levelMode.set(((LevelEmitterContainer) this.cvb).getLevelMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
|
||||
this.level.setText(Out = Long.toString(result));
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("LevelEmitter.Value", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
|
||||
} catch (final NumberFormatException e) {
|
||||
// nope..
|
||||
this.level.setText("0");
|
||||
@@ -219,7 +219,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("LevelEmitter.Value", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+36
-36
@@ -36,29 +36,29 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.client.gui.AEBaseMEScreen;
|
||||
import appeng.client.gui.widgets.*;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.CraftingStatusContainer;
|
||||
import appeng.container.implementations.MEMonitorableContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.CraftingMatrixSlot;
|
||||
import appeng.container.slot.FakeCraftingMatrixSlot;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.parts.reporting.AbstractPartTerminal;
|
||||
import appeng.tile.misc.TileSecurityStation;
|
||||
import appeng.parts.reporting.AbstractTerminalPart;
|
||||
import appeng.tile.misc.SecurityStationTileEntity;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseMEGui<T>
|
||||
public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBaseMEScreen<T>
|
||||
implements ISortSource, IConfigManagerHost {
|
||||
|
||||
private static int craftingGridOffsetX;
|
||||
@@ -71,8 +71,8 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
private final IConfigManager configSrc;
|
||||
private final boolean viewCell;
|
||||
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
private MEGuiTextField searchField;
|
||||
private TabButton craftingStatusBtn;
|
||||
private AETextField searchField;
|
||||
private GuiText myName;
|
||||
private int perRow = 9;
|
||||
private int reservedSpace = 0;
|
||||
@@ -80,17 +80,17 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
private int rows = 0;
|
||||
private int maxRows = Integer.MAX_VALUE;
|
||||
private int standardSize;
|
||||
private GuiSettingToggleButton<ViewItems> viewModeToggle;
|
||||
private GuiSettingToggleButton<SortOrder> sortByToggle;
|
||||
private GuiSettingToggleButton<SortDir> sortDirToggle;
|
||||
private SettingToggleButton<ViewItems> viewModeToggle;
|
||||
private SettingToggleButton<SortOrder> sortByToggle;
|
||||
private SettingToggleButton<SortDir> sortDirToggle;
|
||||
private boolean isAutoFocus = false;
|
||||
private int currentMouseX = 0;
|
||||
private int currentMouseY = 0;
|
||||
|
||||
public GuiMEMonitorable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public MEMonitorableScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
this.repo = new ItemRepo(scrollbar, this);
|
||||
setScrollBar();
|
||||
@@ -110,7 +110,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
|
||||
this.viewCell = te instanceof IViewCellStorage;
|
||||
|
||||
if (te instanceof TileSecurityStation) {
|
||||
if (te instanceof SecurityStationTileEntity) {
|
||||
this.myName = GuiText.Security;
|
||||
} else if (te instanceof WirelessTerminalGuiObject) {
|
||||
this.myName = GuiText.WirelessTerminal;
|
||||
@@ -118,7 +118,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.myName = GuiText.PortableCell;
|
||||
} else if (te instanceof IMEChest) {
|
||||
this.myName = GuiText.Chest;
|
||||
} else if (te instanceof AbstractPartTerminal) {
|
||||
} else if (te instanceof AbstractTerminalPart) {
|
||||
this.myName = GuiText.Terminal;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid GUI target given: " + te);
|
||||
@@ -141,7 +141,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
}
|
||||
|
||||
private void showCraftingStatus() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerCraftingStatus.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(CraftingStatusContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -189,33 +189,33 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
int offset = this.guiTop + 8;
|
||||
|
||||
if (this.customSortOrder) {
|
||||
this.sortByToggle = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.SORT_BY,
|
||||
this.sortByToggle = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.SORT_BY,
|
||||
getSortBy(), Platform::isSortOrderAvailable, this::toggleServerSetting));
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
if (this.viewCell || this instanceof GuiWirelessTerm) {
|
||||
this.viewModeToggle = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
if (this.viewCell || this instanceof WirelessTermScreen) {
|
||||
this.viewModeToggle = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
Settings.VIEW_MODE, getSortDisplay(), this::toggleServerSetting));
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
this.addButton(this.sortDirToggle = new GuiSettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
this.addButton(this.sortDirToggle = new SettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
Settings.SORT_DIRECTION, getSortDir(), this::toggleServerSetting));
|
||||
offset += 20;
|
||||
|
||||
SearchBoxMode searchMode = AEConfig.instance().getTerminalSearchMode();
|
||||
this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.SEARCH_MODE, searchMode,
|
||||
this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.SEARCH_MODE, searchMode,
|
||||
Platform::isSearchModeAvailable, this::toggleTerminalSearchMode));
|
||||
|
||||
offset += 20;
|
||||
|
||||
if (!(this instanceof GuiMEPortableCell) || this instanceof GuiWirelessTerm) {
|
||||
this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.TERMINAL_STYLE,
|
||||
if (!(this instanceof MEPortableCellScreen) || this instanceof WirelessTermScreen) {
|
||||
this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.TERMINAL_STYLE,
|
||||
terminalStyle, this::toggleTerminalStyle));
|
||||
}
|
||||
|
||||
this.searchField = new MEGuiTextField(this.font, this.guiLeft + Math.max(80, this.offsetX), this.guiTop + 4, 90,
|
||||
this.searchField = new AETextField(this.font, this.guiLeft + Math.max(80, this.offsetX), this.guiTop + 4, 90,
|
||||
12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField.setMaxStringLength(25);
|
||||
@@ -223,8 +223,8 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.searchField.setSelectionColor(0xFF008000);
|
||||
this.searchField.setVisible(true);
|
||||
|
||||
if (this.viewCell || this instanceof GuiWirelessTerm) {
|
||||
this.craftingStatusBtn = this.addButton(new GuiTabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
|
||||
if (this.viewCell || this instanceof WirelessTermScreen) {
|
||||
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(), this.itemRenderer, btn -> showCraftingStatus()));
|
||||
this.craftingStatusBtn.setHideEdge(13);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
}
|
||||
}
|
||||
|
||||
if (s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix) {
|
||||
if (s instanceof CraftingMatrixSlot || s instanceof FakeCraftingMatrixSlot) {
|
||||
if (s.xPos > 0 && s.yPos > 0) {
|
||||
craftingGridOffsetX = Math.min(craftingGridOffsetX, s.xPos);
|
||||
craftingGridOffsetY = Math.min(craftingGridOffsetY, s.yPos);
|
||||
@@ -312,7 +312,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
final int x_width = 197;
|
||||
blit(offsetX, offsetY, 0, 0, x_width, 18);
|
||||
|
||||
if (this.viewCell || (this instanceof GuiSecurityStation)) {
|
||||
if (this.viewCell || (this instanceof SecurityStationScreen)) {
|
||||
blit(offsetX + x_width, offsetY, x_width, 0, 46, 128);
|
||||
}
|
||||
|
||||
@@ -482,23 +482,23 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
private void toggleTerminalSearchMode(GuiSettingToggleButton<SearchBoxMode> btn, boolean backwards) {
|
||||
private void toggleTerminalSearchMode(SettingToggleButton<SearchBoxMode> btn, boolean backwards) {
|
||||
SearchBoxMode next = btn.getNextValue(backwards);
|
||||
AEConfig.instance().setTerminalSearchMode(next);
|
||||
btn.set(next);
|
||||
this.reinitalize();
|
||||
}
|
||||
|
||||
private void toggleTerminalStyle(GuiSettingToggleButton<TerminalStyle> btn, boolean backwards) {
|
||||
private void toggleTerminalStyle(SettingToggleButton<TerminalStyle> btn, boolean backwards) {
|
||||
TerminalStyle next = btn.getNextValue(backwards);
|
||||
AEConfig.instance().setTerminalStyle(next);
|
||||
btn.set(next);
|
||||
this.reinitalize();
|
||||
}
|
||||
|
||||
private <S extends Enum<S>> void toggleServerSetting(GuiSettingToggleButton<S> btn, boolean backwards) {
|
||||
private <S extends Enum<S>> void toggleServerSetting(SettingToggleButton<S> btn, boolean backwards) {
|
||||
S next = btn.getNextValue(backwards);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig(btn.getSetting().name(), next.name()));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket(btn.getSetting().name(), next.name()));
|
||||
btn.set(next);
|
||||
}
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import appeng.container.implementations.MEPortableCellContainer;
|
||||
|
||||
public class GuiMEPortableCell extends GuiMEMonitorable<ContainerMEPortableCell> {
|
||||
public class MEPortableCellScreen extends MEMonitorableScreen<MEPortableCellContainer> {
|
||||
|
||||
public GuiMEPortableCell(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public MEPortableCellScreen(MEPortableCellContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+10
-10
@@ -23,18 +23,18 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerMolecularAssembler;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.container.implementations.MolecularAssemblerContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiMolecularAssembler extends GuiUpgradeable<ContainerMolecularAssembler> {
|
||||
public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssemblerContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiMolecularAssembler(ContainerMolecularAssembler container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public MolecularAssemblerScreen(MolecularAssemblerContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
@@ -43,14 +43,14 @@ public class GuiMolecularAssembler extends GuiUpgradeable<ContainerMolecularAsse
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/molecular_assembler.png", 139, 36, 148, 201, 6, 18,
|
||||
this.pb = new ProgressBar(this.container, "guis/molecular_assembler.png", 139, 36, 148, 201, 6, 18,
|
||||
Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
}
|
||||
+6
-6
@@ -32,25 +32,25 @@ import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.container.implementations.ContainerNetworkStatus;
|
||||
import appeng.container.implementations.NetworkStatusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiNetworkStatus extends AEBaseGui<ContainerNetworkStatus> implements ISortSource {
|
||||
public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> implements ISortSource {
|
||||
|
||||
private final ItemRepo repo;
|
||||
private final int rows = 4;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiNetworkStatus(ContainerNetworkStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public NetworkStatusScreen(NetworkStatusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
|
||||
this.setScrollBar(scrollbar);
|
||||
this.repo = new ItemRepo(scrollbar, this);
|
||||
+9
-9
@@ -22,18 +22,18 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerNetworkTool;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.NetworkToolContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
|
||||
|
||||
private GuiToggleButton tFacades;
|
||||
private ToggleButton tFacades;
|
||||
|
||||
public GuiNetworkTool(ContainerNetworkTool container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public NetworkToolScreen(NetworkToolContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.tFacades = new GuiToggleButton(this.guiLeft - 18, this.guiTop + 8, 23, 22,
|
||||
this.tFacades = new ToggleButton(this.guiLeft - 18, this.guiTop + 8, 23, 22,
|
||||
GuiText.TransparentFacades.getLocal(), GuiText.TransparentFacadesHint.getLocal(),
|
||||
btn -> toggleFacades());
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
}
|
||||
|
||||
private void toggleFacades() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("NetworkTool", "Toggle"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("NetworkTool", "Toggle"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+20
-20
@@ -24,15 +24,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.PatternTermContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer> {
|
||||
|
||||
private static final String BACKGROUND_CRAFTING_MODE = "guis/pattern.png";
|
||||
private static final String BACKGROUND_PROCESSING_MODE = "guis/pattern2.png";
|
||||
@@ -43,12 +43,12 @@ public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
private static final String CRAFTMODE_CRFTING = "1";
|
||||
private static final String CRAFTMODE_PROCESSING = "0";
|
||||
|
||||
private GuiTabButton tabCraftButton;
|
||||
private GuiTabButton tabProcessButton;
|
||||
private GuiActionButton substitutionsEnabledBtn;
|
||||
private GuiActionButton substitutionsDisabledBtn;
|
||||
private TabButton tabCraftButton;
|
||||
private TabButton tabProcessButton;
|
||||
private ActionButton substitutionsEnabledBtn;
|
||||
private ActionButton substitutionsDisabledBtn;
|
||||
|
||||
public GuiPatternTerm(ContainerPatternTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public PatternTermScreen(PatternTermContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
@@ -57,50 +57,50 @@ public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.tabCraftButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.getLocal(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
|
||||
this.addButton(this.tabCraftButton);
|
||||
|
||||
this.tabProcessButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
|
||||
this.addButton(this.tabProcessButton);
|
||||
|
||||
this.substitutionsEnabledBtn = new GuiActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
this.substitutionsEnabledBtn = new ActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
ActionItems.ENABLE_SUBSTITUTION, act -> toggleSubstitutions(SUBSITUTION_DISABLE));
|
||||
this.substitutionsEnabledBtn.setHalfSize(true);
|
||||
this.addButton(this.substitutionsEnabledBtn);
|
||||
|
||||
this.substitutionsDisabledBtn = new GuiActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
this.substitutionsDisabledBtn = new ActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
ActionItems.DISABLE_SUBSTITUTION, act -> toggleSubstitutions(SUBSITUTION_ENABLE));
|
||||
this.substitutionsDisabledBtn.setHalfSize(true);
|
||||
this.addButton(this.substitutionsDisabledBtn);
|
||||
|
||||
GuiActionButton clearBtn = new GuiActionButton(this.guiLeft + 74, this.guiTop + this.ySize - 163,
|
||||
ActionButton clearBtn = new ActionButton(this.guiLeft + 74, this.guiTop + this.ySize - 163,
|
||||
ActionItems.CLOSE, act -> clear());
|
||||
clearBtn.setHalfSize(true);
|
||||
this.addButton(clearBtn);
|
||||
|
||||
GuiActionButton encodeBtn = new GuiActionButton(this.guiLeft + 147, this.guiTop + this.ySize - 142,
|
||||
ActionButton encodeBtn = new ActionButton(this.guiLeft + 147, this.guiTop + this.ySize - 142,
|
||||
ActionItems.ENCODE, act -> encode());
|
||||
this.addButton(encodeBtn);
|
||||
}
|
||||
|
||||
private void toggleCraftMode(String mode) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.CraftMode", mode));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.CraftMode", mode));
|
||||
}
|
||||
|
||||
private void toggleSubstitutions(String mode) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Substitute", mode));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Substitute", mode));
|
||||
}
|
||||
|
||||
private void encode() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Encode", "1"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Encode", "1"));
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Clear", "1"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Clear", "1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+13
-13
@@ -23,23 +23,23 @@ import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private GuiNumberBox priority;
|
||||
private NumberBox priority;
|
||||
|
||||
public GuiPriority(ContainerPriority container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public PriorityScreen(PriorityContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getPriorityHost());
|
||||
this.subGui = new AESubScreen(this, container.getPriorityHost());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +63,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
|
||||
this.subGui.addBackButton(this::addButton, 154, 0);
|
||||
|
||||
this.priority = new GuiNumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
this.priority = new NumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
Long.class);
|
||||
this.priority.setEnableBackgroundDrawing(false);
|
||||
this.priority.setMaxStringLength(16);
|
||||
@@ -109,7 +109,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
|
||||
this.priority.setText(out = Long.toString(result));
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
} catch (final NumberFormatException e) {
|
||||
// nope..
|
||||
this.priority.setText("0");
|
||||
@@ -135,7 +135,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -162,7 +162,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,13 +22,13 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.QNBContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiQNB extends AEBaseGui<ContainerQNB> {
|
||||
public class QNBScreen extends AEBaseScreen<QNBContainer> {
|
||||
|
||||
public GuiQNB(ContainerQNB container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public QNBScreen(QNBContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
+7
-7
@@ -27,18 +27,18 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerQuartzKnife;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.QuartzKnifeContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
||||
|
||||
private TextFieldWidget name;
|
||||
|
||||
public GuiQuartzKnife(ContainerQuartzKnife container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public QuartzKnifeScreen(QuartzKnifeContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 184;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
if (this.name.isFocused() && this.name.charTyped(character, key)) {
|
||||
final String Out = this.name.getText();
|
||||
container.setName(Out);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("QuartzKnife.Name", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("QuartzKnife.Name", Out));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
if (this.name.keyPressed(keyCode, scanCode, p_keyPressed_3_)) {
|
||||
final String Out = this.name.getText();
|
||||
container.setName(Out);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("QuartzKnife.Name", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("QuartzKnife.Name", Out));
|
||||
return true;
|
||||
}
|
||||
|
||||
+17
-17
@@ -23,22 +23,22 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerSecurityStation;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.SecurityStationContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStation> {
|
||||
public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationContainer> {
|
||||
|
||||
private GuiToggleButton inject;
|
||||
private GuiToggleButton extract;
|
||||
private GuiToggleButton craft;
|
||||
private GuiToggleButton build;
|
||||
private GuiToggleButton security;
|
||||
private ToggleButton inject;
|
||||
private ToggleButton extract;
|
||||
private ToggleButton craft;
|
||||
private ToggleButton build;
|
||||
private ToggleButton security;
|
||||
|
||||
public GuiSecurityStation(ContainerSecurityStation container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public SecurityStationScreen(SecurityStationContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setCustomSortOrder(false);
|
||||
this.setReservedSpace(33);
|
||||
@@ -50,7 +50,7 @@ public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStatio
|
||||
|
||||
private void toggleOption(SecurityPermissions permission) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketValueConfig("TileSecurityStation.ToggleOption", permission.name()));
|
||||
.sendToServer(new ConfigValuePacket("TileSecurityStation.ToggleOption", permission.name()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,23 +58,23 @@ public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStatio
|
||||
super.init();
|
||||
|
||||
final int top = this.guiTop + this.ySize - 116;
|
||||
this.inject = this.addButton(new GuiToggleButton(this.guiLeft + 56, top, 11 * 16, 12 * 16,
|
||||
this.inject = this.addButton(new ToggleButton(this.guiLeft + 56, top, 11 * 16, 12 * 16,
|
||||
SecurityPermissions.INJECT.getTranslatedName(), SecurityPermissions.INJECT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.INJECT)));
|
||||
|
||||
this.extract = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1,
|
||||
this.extract = this.addButton(new ToggleButton(this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1,
|
||||
SecurityPermissions.EXTRACT.getTranslatedName(), SecurityPermissions.EXTRACT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.EXTRACT)));
|
||||
|
||||
this.craft = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2,
|
||||
this.craft = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2,
|
||||
SecurityPermissions.CRAFT.getTranslatedName(), SecurityPermissions.CRAFT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.CRAFT)));
|
||||
|
||||
this.build = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3,
|
||||
this.build = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3,
|
||||
SecurityPermissions.BUILD.getTranslatedName(), SecurityPermissions.BUILD.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.BUILD)));
|
||||
|
||||
this.security = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4,
|
||||
this.security = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4,
|
||||
SecurityPermissions.SECURITY.getTranslatedName(), SecurityPermissions.SECURITY.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.SECURITY)));
|
||||
}
|
||||
+4
-4
@@ -23,16 +23,16 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.SkyChestContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiSkyChest extends AEBaseGui<ContainerSkyChest> {
|
||||
public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation(AppEng.MOD_ID, "textures/guis/skychest.png");
|
||||
|
||||
public GuiSkyChest(ContainerSkyChest container, PlayerInventory playerInv, ITextComponent title) {
|
||||
public SkyChestScreen(SkyChestContainer container, PlayerInventory playerInv, ITextComponent title) {
|
||||
super(container, playerInv, title);
|
||||
this.ySize = 195;
|
||||
}
|
||||
+4
-4
@@ -22,15 +22,15 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.container.implementations.ContainerSpatialIOPort;
|
||||
import appeng.container.implementations.SpatialIOPortContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiSpatialIOPort extends AEBaseGui<ContainerSpatialIOPort> {
|
||||
public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
|
||||
|
||||
public GuiSpatialIOPort(ContainerSpatialIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public SpatialIOPortScreen(SpatialIOPortContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
}
|
||||
+23
-23
@@ -26,39 +26,39 @@ import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.StorageFilter;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.container.implementations.ContainerStorageBus;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.container.implementations.StorageBusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
|
||||
|
||||
private GuiSettingToggleButton<AccessRestriction> rwMode;
|
||||
private GuiSettingToggleButton<StorageFilter> storageFilter;
|
||||
private SettingToggleButton<AccessRestriction> rwMode;
|
||||
private SettingToggleButton<StorageFilter> storageFilter;
|
||||
|
||||
public GuiStorageBus(ContainerStorageBus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public StorageBusScreen(StorageBusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, btn -> clear()));
|
||||
addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH, btn -> partition()));
|
||||
this.rwMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS,
|
||||
addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, btn -> clear()));
|
||||
addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH, btn -> partition()));
|
||||
this.rwMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS,
|
||||
AccessRestriction.READ_WRITE);
|
||||
this.storageFilter = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.storageFilter = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.storageFilter);
|
||||
@@ -76,11 +76,11 @@ public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
}
|
||||
|
||||
if (this.storageFilter != null) {
|
||||
this.storageFilter.set(((ContainerStorageBus) this.cvb).getStorageFilter());
|
||||
this.storageFilter.set(((StorageBusContainer) this.cvb).getStorageFilter());
|
||||
}
|
||||
|
||||
if (this.rwMode != null) {
|
||||
this.rwMode.set(((ContainerStorageBus) this.cvb).getReadWriteMode());
|
||||
this.rwMode.set(((StorageBusContainer) this.cvb).getReadWriteMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,15 +90,15 @@ public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
}
|
||||
|
||||
private void partition() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("StorageBus.Action", "Partition"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("StorageBus.Action", "Partition"));
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("StorageBus.Action", "Clear"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("StorageBus.Action", "Clear"));
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
}
|
||||
+19
-19
@@ -29,25 +29,25 @@ import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.UpgradeableContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.parts.automation.PartExportBus;
|
||||
import appeng.parts.automation.PartImportBus;
|
||||
import appeng.parts.automation.ExportBusPart;
|
||||
import appeng.parts.automation.ImportBusPart;
|
||||
|
||||
public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T> {
|
||||
public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScreen<T> {
|
||||
|
||||
protected final ContainerUpgradeable cvb;
|
||||
protected final UpgradeableContainer cvb;
|
||||
protected final IUpgradeableHost bc;
|
||||
|
||||
protected GuiSettingToggleButton<RedstoneMode> redstoneMode;
|
||||
protected GuiSettingToggleButton<FuzzyMode> fuzzyMode;
|
||||
protected GuiSettingToggleButton<YesNo> craftMode;
|
||||
protected GuiSettingToggleButton<SchedulingMode> schedulingMode;
|
||||
protected SettingToggleButton<RedstoneMode> redstoneMode;
|
||||
protected SettingToggleButton<FuzzyMode> fuzzyMode;
|
||||
protected SettingToggleButton<YesNo> craftMode;
|
||||
protected SettingToggleButton<SchedulingMode> schedulingMode;
|
||||
|
||||
public GuiUpgradeable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public UpgradeableScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.cvb = container;
|
||||
|
||||
@@ -67,16 +67,16 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
protected void addButtons() {
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
addButton(this.fuzzyMode);
|
||||
this.craftMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY,
|
||||
this.craftMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY,
|
||||
YesNo.NO);
|
||||
addButton(this.craftMode);
|
||||
this.schedulingMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.schedulingMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT);
|
||||
addButton(this.schedulingMode);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
if (this.schedulingMode != null) {
|
||||
this.schedulingMode.setVisibility(
|
||||
this.bc.getInstalledUpgrades(Upgrades.CAPACITY) > 0 && this.bc instanceof PartExportBus);
|
||||
this.bc.getInstalledUpgrades(Upgrades.CAPACITY) > 0 && this.bc instanceof ExportBusPart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
protected GuiText getName() {
|
||||
return this.bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus;
|
||||
return this.bc instanceof ImportBusPart ? GuiText.ImportBus : GuiText.ExportBus;
|
||||
}
|
||||
|
||||
}
|
||||
+12
-12
@@ -24,19 +24,19 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.container.implementations.VibrationChamberContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.misc.VibrationChamberTileEntity;
|
||||
|
||||
public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiVibrationChamber(ContainerVibrationChamber container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public VibrationChamberScreen(VibrationChamberContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL);
|
||||
this.pb = new ProgressBar(this.container, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
this.font.drawString(this.getGuiDisplayName(GuiText.VibrationChamber.getLocal()), 8, 6, 4210752);
|
||||
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
this.pb.setFullMsg(TileVibrationChamber.POWER_PER_TICK * this.container.getCurrentProgress()
|
||||
/ TileVibrationChamber.DILATION_SCALING + " AE/t");
|
||||
this.pb.setFullMsg(VibrationChamberTileEntity.POWER_PER_TICK * this.container.getCurrentProgress()
|
||||
/ VibrationChamberTileEntity.DILATION_SCALING + " AE/t");
|
||||
|
||||
if (this.container.getRemainingBurnTime() > 0) {
|
||||
final int i1 = this.container.getRemainingBurnTime() * 12 / 100;
|
||||
+4
-4
@@ -22,15 +22,15 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.container.implementations.ContainerWireless;
|
||||
import appeng.container.implementations.WirelessContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiWireless extends AEBaseGui<ContainerWireless> {
|
||||
public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
|
||||
|
||||
public GuiWireless(ContainerWireless container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public WirelessScreen(WirelessContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
+3
-3
@@ -21,12 +21,12 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import appeng.container.implementations.MEPortableCellContainer;
|
||||
|
||||
// FIXME: Extended from GuiPortableCell before... Why?
|
||||
public class GuiWirelessTerm extends GuiMEMonitorable<ContainerMEPortableCell> {
|
||||
public class WirelessTermScreen extends MEMonitorableScreen<MEPortableCellContainer> {
|
||||
|
||||
public GuiWirelessTerm(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public WirelessTermScreen(MEPortableCellContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
*
|
||||
* The rendering does pay attention to the size of the '_' caret.
|
||||
*/
|
||||
public class MEGuiTextField extends TextFieldWidget {
|
||||
public class AETextField extends TextFieldWidget {
|
||||
private static final int PADDING = 2;
|
||||
|
||||
private final int _fontPad;
|
||||
@@ -50,8 +50,8 @@ public class MEGuiTextField extends TextFieldWidget {
|
||||
* @param width absolute width
|
||||
* @param height absolute height
|
||||
*/
|
||||
public MEGuiTextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
public AETextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getCharWidth('_'),
|
||||
height - 2 * PADDING, "");
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ import java.util.regex.Pattern;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public class GuiActionButton extends GuiIconButton implements ITooltip {
|
||||
public class ActionButton extends IconButton implements ITooltip {
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private final int iconIndex;
|
||||
|
||||
public GuiActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
public ActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
super(x, y, btn -> onPress.accept(action));
|
||||
|
||||
ButtonToolTips displayName;
|
||||
@@ -9,12 +9,12 @@ public final class CommonButtons {
|
||||
private CommonButtons() {
|
||||
}
|
||||
|
||||
public static GuiSettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new GuiSettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
public static SettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new SettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
CommonButtons::togglePowerUnit);
|
||||
}
|
||||
|
||||
private static void togglePowerUnit(GuiSettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
private static void togglePowerUnit(SettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
AEConfig.instance().nextPowerUnit(backwards);
|
||||
button.set(AEConfig.instance().getSelectedPowerUnit());
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@ import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class GuiCustomSlot extends AbstractGui implements ITooltip {
|
||||
public abstract class CustomSlotWidget extends AbstractGui implements ITooltip {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int id;
|
||||
|
||||
public GuiCustomSlot(final int id, final int x, final int y) {
|
||||
public CustomSlotWidget(final int id, final int x, final int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.id = id;
|
||||
+2
-2
@@ -26,13 +26,13 @@ import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public abstract class GuiIconButton extends Button implements ITooltip {
|
||||
public abstract class IconButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
|
||||
private boolean halfSize = false;
|
||||
|
||||
public GuiIconButton(final int x, final int y, IPressable onPress) {
|
||||
public IconButton(final int x, final int y, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,12 +22,12 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
|
||||
// FIXME: Fix this piece of crap (i.e. onChange listener)
|
||||
public class GuiNumberBox extends TextFieldWidget {
|
||||
public class NumberBox extends TextFieldWidget {
|
||||
|
||||
private final Class type;
|
||||
|
||||
public GuiNumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
public NumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
super(fontRenderer, x, y, width, height, "0");
|
||||
this.type = type;
|
||||
}
|
||||
+5
-5
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiProgressBar extends Widget implements ITooltip {
|
||||
public class ProgressBar extends Widget implements ITooltip {
|
||||
|
||||
private final IProgressProvider source;
|
||||
private final ResourceLocation texture;
|
||||
@@ -36,13 +36,13 @@ public class GuiProgressBar extends Widget implements ITooltip {
|
||||
private final String titleName;
|
||||
private String fullMsg;
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
this(source, texture, posX, posY, u, y, width, height, dir, null);
|
||||
}
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
super(posX, posY, width, height, "");
|
||||
this.source = source;
|
||||
this.texture = new ResourceLocation("appliedenergistics2", "textures/" + texture);
|
||||
+7
-7
@@ -22,9 +22,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
|
||||
public class GuiScrollbar implements IScrollSource {
|
||||
public class Scrollbar implements IScrollSource {
|
||||
|
||||
private int displayX = 0;
|
||||
private int displayY = 0;
|
||||
@@ -36,7 +36,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
private int minScroll = 0;
|
||||
private int currentScroll = 0;
|
||||
|
||||
public void draw(final AEBaseGui<?> g) {
|
||||
public void draw(final AEBaseScreen<?> g) {
|
||||
g.bindTexture("minecraft", "gui/container/creative_inventory/tabs.png");
|
||||
RenderSystem.color4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayX;
|
||||
}
|
||||
|
||||
public GuiScrollbar setLeft(final int v) {
|
||||
public Scrollbar setLeft(final int v) {
|
||||
this.displayX = v;
|
||||
return this;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayY;
|
||||
}
|
||||
|
||||
public GuiScrollbar setTop(final int v) {
|
||||
public Scrollbar setTop(final int v) {
|
||||
this.displayY = v;
|
||||
return this;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public GuiScrollbar setWidth(final int v) {
|
||||
public Scrollbar setWidth(final int v) {
|
||||
this.width = v;
|
||||
return this;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public GuiScrollbar setHeight(final int v) {
|
||||
public Scrollbar setHeight(final int v) {
|
||||
this.height = v;
|
||||
return this;
|
||||
}
|
||||
+6
-6
@@ -20,19 +20,19 @@ package appeng.client.gui.widgets;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.core.sync.packets.ConfigButtonPacket;
|
||||
|
||||
/**
|
||||
* Convenience button that automatically sends settings changes to the server.
|
||||
*/
|
||||
public class GuiServerSettingToggleButton<T extends Enum<T>> extends GuiSettingToggleButton<T> {
|
||||
public class ServerSettingToggleButton<T extends Enum<T>> extends SettingToggleButton<T> {
|
||||
|
||||
public GuiServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, GuiServerSettingToggleButton::sendToServer);
|
||||
public ServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, ServerSettingToggleButton::sendToServer);
|
||||
}
|
||||
|
||||
private static <T extends Enum<T>> void sendToServer(GuiSettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new PacketConfigButton(button.getSetting(), backwards));
|
||||
private static <T extends Enum<T>> void sendToServer(SettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(button.getSetting(), backwards));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-10
@@ -49,29 +49,29 @@ import appeng.api.config.YesNo;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.util.EnumCycler;
|
||||
|
||||
public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
private static final Pattern COMPILE = Pattern.compile("%s");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private static Map<EnumPair, ButtonAppearance> appearances;
|
||||
private final Settings buttonSetting;
|
||||
private final IHandler<GuiSettingToggleButton<T>> onPress;
|
||||
private final IHandler<SettingToggleButton<T>> onPress;
|
||||
private final EnumSet<T> validValues;
|
||||
private String fillVar;
|
||||
private T currentValue;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IHandler<T extends GuiSettingToggleButton<?>> {
|
||||
public interface IHandler<T extends SettingToggleButton<?>> {
|
||||
void handle(T button, boolean backwards);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<SettingToggleButton<T>> onPress) {
|
||||
this(x, y, setting, val, t -> true, onPress);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
super(x, y, GuiSettingToggleButton::onPress);
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<SettingToggleButton<T>> onPress) {
|
||||
super(x, y, SettingToggleButton::onPress);
|
||||
this.onPress = onPress;
|
||||
|
||||
// Build a list of values (in order) that are valid w.r.t. the given predicate
|
||||
@@ -223,8 +223,8 @@ public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
}
|
||||
|
||||
private static void onPress(Button btn) {
|
||||
if (btn instanceof GuiSettingToggleButton) {
|
||||
((GuiSettingToggleButton<?>) btn).triggerPress();
|
||||
if (btn instanceof SettingToggleButton) {
|
||||
((SettingToggleButton<?>) btn).triggerPress();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -27,7 +27,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiTabButton extends Button implements ITooltip {
|
||||
public class TabButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private final ItemRenderer itemRenderer;
|
||||
@@ -35,8 +35,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
private int myIcon = -1;
|
||||
private ItemStack myItem;
|
||||
|
||||
public GuiTabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
|
||||
this.myIcon = ico;
|
||||
@@ -52,8 +52,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
* @param message mouse over message
|
||||
* @param ir renderer
|
||||
*/
|
||||
public GuiTabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
this.myItem = ico;
|
||||
this.itemRenderer = ir;
|
||||
+3
-3
@@ -28,7 +28,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public class GuiToggleButton extends Button implements ITooltip {
|
||||
public class ToggleButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
@@ -40,8 +40,8 @@ public class GuiToggleButton extends Button implements ITooltip {
|
||||
|
||||
private boolean isActive;
|
||||
|
||||
public GuiToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
public ToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
this.iconIdxOn = on;
|
||||
this.iconIdxOff = off;
|
||||
@@ -40,7 +40,7 @@ import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.items.storage.ItemViewCell;
|
||||
import appeng.items.storage.ViewCellItem;
|
||||
import appeng.util.ItemSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
@@ -90,7 +90,7 @@ public class ItemRepo {
|
||||
}
|
||||
|
||||
public void setViewCell(final ItemStack[] list) {
|
||||
this.myPartitionList = ItemViewCell.createFilter(list);
|
||||
this.myPartitionList = ViewCellItem.createFilter(list);
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.items.misc.EncodedPatternItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class SlotDisconnected extends AppEngSlot {
|
||||
@@ -53,8 +53,8 @@ public class SlotDisconnected extends AppEngSlot {
|
||||
public ItemStack getDisplayStack() {
|
||||
if (Platform.isClient()) {
|
||||
final ItemStack is = super.getStack();
|
||||
if (!is.isEmpty() && is.getItem() instanceof ItemEncodedPattern) {
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
if (!is.isEmpty() && is.getItem() instanceof EncodedPatternItem) {
|
||||
final EncodedPatternItem iep = (EncodedPatternItem) is.getItem();
|
||||
final ItemStack out = iep.getOutput(is);
|
||||
if (!out.isEmpty()) {
|
||||
return out;
|
||||
|
||||
@@ -30,7 +30,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import appeng.items.parts.FacadeItem;
|
||||
|
||||
/**
|
||||
* This baked model class is used as a dispatcher to redirect the renderer to
|
||||
@@ -52,11 +52,11 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel {
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
|
||||
LivingEntity entity) {
|
||||
if (!(stack.getItem() instanceof ItemFacade)) {
|
||||
if (!(stack.getItem() instanceof FacadeItem)) {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
ItemFacade itemFacade = (ItemFacade) stack.getItem();
|
||||
FacadeItem itemFacade = (FacadeItem) stack.getItem();
|
||||
|
||||
ItemStack textureItem = itemFacade.getTextureItem(stack);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
import appeng.parts.misc.PartCableAnchor;
|
||||
import appeng.parts.misc.CableAnchorPart;
|
||||
import appeng.thirdparty.codechicken.lib.model.CachedFormat;
|
||||
import appeng.thirdparty.codechicken.lib.model.Quad;
|
||||
import appeng.thirdparty.codechicken.lib.model.pipeline.BakedPipeline;
|
||||
@@ -123,7 +123,7 @@ public class FacadeBuilder {
|
||||
FacadeRenderState facadeRenderState = entry.getValue();
|
||||
boolean renderStilt = !sidesWithParts.contains(side);
|
||||
if (layer == RenderType.getCutout() && renderStilt) {
|
||||
for (ResourceLocation part : PartCableAnchor.FACADE_MODELS.getModels()) {
|
||||
for (ResourceLocation part : CableAnchorPart.FACADE_MODELS.getModels()) {
|
||||
IBakedModel partModel = modelLookup.apply(part);
|
||||
QuadRotator rotator = new QuadRotator();
|
||||
quads.addAll(rotator.rotateQuads(gatherQuads(partModel, null, rand, EmptyModelData.INSTANCE), side,
|
||||
|
||||
@@ -29,21 +29,21 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.render.TesrRenderHelper;
|
||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
import appeng.tile.crafting.CraftingMonitorTileEntity;
|
||||
|
||||
/**
|
||||
* Renders the item currently being crafted
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class CraftingMonitorTESR extends TileEntityRenderer<TileCraftingMonitorTile> {
|
||||
public class CraftingMonitorTESR extends TileEntityRenderer<CraftingMonitorTileEntity> {
|
||||
|
||||
public CraftingMonitorTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
|
||||
super(rendererDispatcherIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileCraftingMonitorTile te, float partialTicks, MatrixStack matrixStack,
|
||||
IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
|
||||
public void render(CraftingMonitorTileEntity te, float partialTicks, MatrixStack matrixStack,
|
||||
IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
|
||||
|
||||
Direction facing = te.getForward();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
|
||||
import appeng.client.render.DelegateBakedModel;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.items.misc.EncodedPatternItem;
|
||||
|
||||
/**
|
||||
* This model is used to substitute the crafting result's item model for our
|
||||
@@ -116,7 +116,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
@Nullable LivingEntity entity) {
|
||||
boolean shiftHeld = Screen.hasShiftDown();
|
||||
if (shiftHeld) {
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
EncodedPatternItem iep = (EncodedPatternItem) stack.getItem();
|
||||
ItemStack output = iep.getOutput(stack);
|
||||
if (!output.isEmpty()) {
|
||||
IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher()
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.block.crafting.BlockCraftingMonitor;
|
||||
import appeng.block.crafting.CraftingMonitorBlock;
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
import appeng.client.render.model.AEModelData;
|
||||
import appeng.tile.crafting.CraftingMonitorModelData;
|
||||
@@ -76,7 +76,7 @@ public class MonitorBakedModel extends CraftingCubeBakedModel {
|
||||
|
||||
// Now add the three layered light textures
|
||||
AEColor color = getColor(modelData);
|
||||
boolean powered = state.get(BlockCraftingMonitor.POWERED);
|
||||
boolean powered = state.get(CraftingMonitorBlock.POWERED);
|
||||
|
||||
builder.setRenderFullBright(powered);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
|
||||
|
||||
import appeng.decorative.solid.BlockQuartzGlass;
|
||||
import appeng.decorative.solid.QuartzGlassBlock;
|
||||
import appeng.decorative.solid.GlassState;
|
||||
|
||||
class GlassBakedModel implements IDynamicBakedModel {
|
||||
@@ -322,7 +322,7 @@ class GlassBakedModel implements IDynamicBakedModel {
|
||||
}
|
||||
|
||||
private static boolean isGlassBlock(IBlockReader world, BlockPos pos, Direction facing) {
|
||||
return world.getBlockState(pos.offset(facing)).getBlock() instanceof BlockQuartzGlass;
|
||||
return world.getBlockState(pos.offset(facing)).getBlock() instanceof QuartzGlassBlock;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
import appeng.tile.spatial.SpatialPylonTileEntity;
|
||||
|
||||
/**
|
||||
* The baked model that will be used for rendering the spatial pylon.
|
||||
@@ -59,16 +59,16 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
|
||||
if (flags != 0) {
|
||||
Direction ori = null;
|
||||
int displayAxis = flags & TileSpatialPylon.DISPLAY_Z;
|
||||
if (displayAxis == TileSpatialPylon.DISPLAY_X) {
|
||||
int displayAxis = flags & SpatialPylonTileEntity.DISPLAY_Z;
|
||||
if (displayAxis == SpatialPylonTileEntity.DISPLAY_X) {
|
||||
ori = Direction.EAST;
|
||||
|
||||
if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MAX) {
|
||||
builder.setUvRotation(Direction.SOUTH, 1);
|
||||
builder.setUvRotation(Direction.NORTH, 1);
|
||||
builder.setUvRotation(Direction.UP, 2);
|
||||
builder.setUvRotation(Direction.DOWN, 2);
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MIN) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MIN) {
|
||||
builder.setUvRotation(Direction.SOUTH, 2);
|
||||
builder.setUvRotation(Direction.NORTH, 2);
|
||||
builder.setUvRotation(Direction.UP, 1);
|
||||
@@ -81,9 +81,9 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
}
|
||||
}
|
||||
|
||||
else if (displayAxis == TileSpatialPylon.DISPLAY_Y) {
|
||||
else if (displayAxis == SpatialPylonTileEntity.DISPLAY_Y) {
|
||||
ori = Direction.UP;
|
||||
if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MAX) {
|
||||
builder.setUvRotation(Direction.NORTH, 3);
|
||||
builder.setUvRotation(Direction.SOUTH, 3);
|
||||
builder.setUvRotation(Direction.EAST, 3);
|
||||
@@ -91,12 +91,12 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
}
|
||||
}
|
||||
|
||||
else if (displayAxis == TileSpatialPylon.DISPLAY_Z) {
|
||||
else if (displayAxis == SpatialPylonTileEntity.DISPLAY_Z) {
|
||||
ori = Direction.NORTH;
|
||||
if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MAX) {
|
||||
builder.setUvRotation(Direction.EAST, 2);
|
||||
builder.setUvRotation(Direction.WEST, 1);
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MIN) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MIN) {
|
||||
builder.setUvRotation(Direction.EAST, 1);
|
||||
builder.setUvRotation(Direction.WEST, 2);
|
||||
builder.setUvRotation(Direction.UP, 3);
|
||||
@@ -115,7 +115,7 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
this.textures.get(getTextureTypeFromSideOutside(flags, ori, Direction.WEST)));
|
||||
builder.addCube(0, 0, 0, 16, 16, 16);
|
||||
|
||||
if ((flags & TileSpatialPylon.DISPLAY_POWERED_ENABLED) == TileSpatialPylon.DISPLAY_POWERED_ENABLED) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_POWERED_ENABLED) == SpatialPylonTileEntity.DISPLAY_POWERED_ENABLED) {
|
||||
builder.setRenderFullBright(true);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
}
|
||||
|
||||
private int getFlags(IModelData modelData) {
|
||||
Integer flags = modelData.getData(TileSpatialPylon.STATE);
|
||||
Integer flags = modelData.getData(SpatialPylonTileEntity.STATE);
|
||||
return flags != null ? flags : 0;
|
||||
}
|
||||
|
||||
@@ -147,11 +147,11 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
return SpatialPylonTextureType.BASE;
|
||||
}
|
||||
|
||||
if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_MIDDLE) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_MIDDLE) {
|
||||
return SpatialPylonTextureType.BASE_SPANNED;
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MIN) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MIN) {
|
||||
return SpatialPylonTextureType.BASE_END;
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MAX) {
|
||||
return SpatialPylonTextureType.BASE_END;
|
||||
}
|
||||
|
||||
@@ -159,17 +159,17 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
|
||||
}
|
||||
|
||||
private static SpatialPylonTextureType getTextureTypeFromSideInside(int flags, Direction ori, Direction dir) {
|
||||
final boolean good = (flags & TileSpatialPylon.DISPLAY_ENABLED) == TileSpatialPylon.DISPLAY_ENABLED;
|
||||
final boolean good = (flags & SpatialPylonTileEntity.DISPLAY_ENABLED) == SpatialPylonTileEntity.DISPLAY_ENABLED;
|
||||
|
||||
if (ori == dir || ori.getOpposite() == dir) {
|
||||
return good ? SpatialPylonTextureType.DIM : SpatialPylonTextureType.RED;
|
||||
}
|
||||
|
||||
if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_MIDDLE) {
|
||||
if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_MIDDLE) {
|
||||
return good ? SpatialPylonTextureType.DIM_SPANNED : SpatialPylonTextureType.RED_SPANNED;
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MIN) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MIN) {
|
||||
return good ? SpatialPylonTextureType.DIM_END : SpatialPylonTextureType.RED_END;
|
||||
} else if ((flags & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) {
|
||||
} else if ((flags & SpatialPylonTileEntity.DISPLAY_MIDDLE) == SpatialPylonTileEntity.DISPLAY_END_MAX) {
|
||||
return good ? SpatialPylonTextureType.DIM_END : SpatialPylonTextureType.RED_END;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,27 +30,26 @@ import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
import appeng.tile.grindstone.CrankTileEntity;
|
||||
|
||||
/**
|
||||
* This FastTESR only handles the animated model of the turning crank. When the
|
||||
* crank is at rest, it is rendered using a normal model.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class CrankTESR extends TileEntityRenderer<TileCrank> {
|
||||
public class CrankTESR extends TileEntityRenderer<CrankTileEntity> {
|
||||
|
||||
public CrankTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
|
||||
super(rendererDispatcherIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileCrank te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn,
|
||||
int combinedOverlayIn) {
|
||||
public void render(CrankTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn,
|
||||
int combinedOverlayIn) {
|
||||
|
||||
// Apply GL transformations relative to the center of the block: 1) TE rotation
|
||||
// and 2) crank rotation
|
||||
|
||||
@@ -18,13 +18,13 @@ import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.tile.storage.DriveTileEntity;
|
||||
|
||||
/**
|
||||
* Renders the drive cell status indicators.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class DriveLedTileEntityRenderer extends TileEntityRenderer<TileDrive> {
|
||||
public class DriveLedTileEntityRenderer extends TileEntityRenderer<DriveTileEntity> {
|
||||
|
||||
private static final EnumMap<DriveSlotState, Vector3f> STATE_COLORS;
|
||||
|
||||
@@ -68,8 +68,8 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<TileDrive> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileDrive drive, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
public void render(DriveTileEntity drive, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
|
||||
if (drive.getCellCount() != 10) {
|
||||
throw new IllegalStateException("Expected drive to have 10 slots");
|
||||
@@ -119,7 +119,7 @@ public class DriveLedTileEntityRenderer extends TileEntityRenderer<TileDrive> {
|
||||
|
||||
}
|
||||
|
||||
private Vector3f getColorForSlot(TileDrive drive, int slot, float partialTicks) {
|
||||
private Vector3f getColorForSlot(DriveTileEntity drive, int slot, float partialTicks) {
|
||||
DriveSlotState state = DriveSlotState.fromCellStatus(drive.getCellStatus(slot));
|
||||
if (state == DriveSlotState.EMPTY) {
|
||||
return null;
|
||||
|
||||
@@ -25,13 +25,13 @@ import appeng.api.features.InscriberProcessType;
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.recipes.handlers.InscriberRecipe;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.tile.misc.InscriberTileEntity;
|
||||
|
||||
/**
|
||||
* Renders the dynamic parts of an inscriber (the presses, the animation and the
|
||||
* item being smashed)
|
||||
*/
|
||||
public final class InscriberTESR extends TileEntityRenderer<TileInscriber> {
|
||||
public final class InscriberTESR extends TileEntityRenderer<InscriberTileEntity> {
|
||||
|
||||
private static final float ITEM_RENDER_SCALE = 1.0f / 1.2f;
|
||||
|
||||
@@ -43,8 +43,8 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileInscriber tile, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLight, int combinedOverlay) {
|
||||
public void render(InscriberTileEntity tile, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLight, int combinedOverlay) {
|
||||
|
||||
// render inscriber
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.client.render.renderable.Renderable;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ModularTESR<T extends AEBaseTile> extends TileEntityRenderer<T> {
|
||||
public class ModularTESR<T extends AEBaseTileEntity> extends TileEntityRenderer<T> {
|
||||
|
||||
private final List<Renderable<? super T>> renderables;
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
|
||||
import appeng.block.storage.BlockSkyChest;
|
||||
import appeng.block.storage.BlockSkyChest.SkyChestType;
|
||||
import appeng.block.storage.SkyChestBlock;
|
||||
import appeng.block.storage.SkyChestBlock.SkyChestType;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.tile.storage.SkyChestTileEntity;
|
||||
|
||||
// This is mostly a copy&paste job of the vanilla chest TESR
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class SkyChestTESR extends TileEntityRenderer<TileSkyChest> {
|
||||
public class SkyChestTESR extends TileEntityRenderer<SkyChestTileEntity> {
|
||||
|
||||
public static final Material TEXTURE_STONE = new Material(Atlases.CHEST_ATLAS,
|
||||
new ResourceLocation(AppEng.MOD_ID, "models/skychest"));
|
||||
@@ -68,8 +68,8 @@ public class SkyChestTESR extends TileEntityRenderer<TileSkyChest> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileSkyChest tileEntityIn, float partialTicks, MatrixStack matrixStackIn,
|
||||
IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||
public void render(SkyChestTileEntity tileEntityIn, float partialTicks, MatrixStack matrixStackIn,
|
||||
IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||
matrixStackIn.push();
|
||||
float f = tileEntityIn.getForward().getHorizontalAngle();
|
||||
matrixStackIn.translate(0.5D, 0.5D, 0.5D);
|
||||
@@ -97,13 +97,13 @@ public class SkyChestTESR extends TileEntityRenderer<TileSkyChest> {
|
||||
chestBottom.render(matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn);
|
||||
}
|
||||
|
||||
protected Material getMaterial(TileSkyChest tileEntity) {
|
||||
protected Material getMaterial(SkyChestTileEntity tileEntity) {
|
||||
SkyChestType type = SkyChestType.BLOCK;
|
||||
if (tileEntity.getWorld() != null) {
|
||||
Block blockType = tileEntity.getBlockState().getBlock();
|
||||
|
||||
if (blockType instanceof BlockSkyChest) {
|
||||
type = ((BlockSkyChest) blockType).type;
|
||||
if (blockType instanceof SkyChestBlock) {
|
||||
type = ((SkyChestBlock) blockType).type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.client.render.model.SkyCompassBakedModel;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
import appeng.tile.misc.SkyCompassTileEntity;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class SkyCompassTESR extends TileEntityRenderer<TileSkyCompass> {
|
||||
public class SkyCompassTESR extends TileEntityRenderer<SkyCompassTileEntity> {
|
||||
|
||||
private static BlockRendererDispatcher blockRenderer;
|
||||
|
||||
@@ -48,8 +48,8 @@ public class SkyCompassTESR extends TileEntityRenderer<TileSkyCompass> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileSkyCompass te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
public void render(SkyCompassTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers,
|
||||
int combinedLightIn, int combinedOverlayIn) {
|
||||
|
||||
if (blockRenderer == null) {
|
||||
blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
@@ -86,7 +86,7 @@ public class SkyCompassTESR extends TileEntityRenderer<TileSkyCompass> {
|
||||
|
||||
}
|
||||
|
||||
private static float getRotation(TileSkyCompass skyCompass) {
|
||||
private static float getRotation(SkyCompassTileEntity skyCompass) {
|
||||
float rotation;
|
||||
|
||||
if (skyCompass.getForward() == Direction.UP || skyCompass.getForward() == Direction.DOWN) {
|
||||
|
||||
Reference in New Issue
Block a user