GUI/Container fixes Ugh
This commit is contained in:
@@ -22,6 +22,7 @@ package appeng.client.gui.implementations;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
@@ -97,9 +98,8 @@ public class GuiCraftAmount extends AEBaseGui {
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
myIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(myIcon);
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
myIcon = ((WirelessTerminalGuiObject) target).getItemStack();
|
||||
this.originalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(myIcon).getGuiHandler(myIcon);
|
||||
}
|
||||
|
||||
if (target instanceof PartTerminal) {
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -83,8 +84,9 @@ public class GuiCraftConfirm extends AEBaseGui {
|
||||
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
|
||||
this.ccc.setGui(this);
|
||||
|
||||
if (te instanceof IWirelessTermHandler) {
|
||||
this.OriginalGui = (GuiBridge) ((IWirelessTermHandler)te).getGuiHandler(((WirelessTerminalGuiObject)te).getItemStack()));
|
||||
if (te instanceof WirelessTerminalGuiObject) {
|
||||
ItemStack itemStack = ((WirelessTerminalGuiObject) te).getItemStack();
|
||||
this.OriginalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(itemStack).getGuiHandler(itemStack);
|
||||
}
|
||||
|
||||
if (te instanceof PartTerminal) {
|
||||
|
||||
@@ -26,6 +26,7 @@ package appeng.client.gui.implementations;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -33,6 +34,7 @@ import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.CraftingCPUStatus;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.registries.WirelessRegistry;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
@@ -84,9 +86,8 @@ public class GuiCraftingStatus extends GuiCraftingCPU {
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
this.myIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
myIcon = ((WirelessTerminalGuiObject) target).getItemStack();
|
||||
this.originalGui = (GuiBridge) AEApi.instance().registries().wireless().getWirelessTerminalHandler(myIcon).getGuiHandler(myIcon);
|
||||
}
|
||||
|
||||
if (target instanceof PartTerminal) {
|
||||
|
||||
@@ -28,11 +28,7 @@ public class GuiMEPortableCell extends GuiMEMonitorable {
|
||||
public GuiMEPortableCell(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
|
||||
super(inventoryPlayer, te);
|
||||
}
|
||||
|
||||
int defaultGetMaxRows() {
|
||||
return super.getMaxRows();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getMaxRows() {
|
||||
return 3;
|
||||
|
||||
@@ -30,6 +30,7 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -78,6 +79,13 @@ public class GuiWirelessCraftingTerminal extends GuiMEMonitorable {
|
||||
this.fontRenderer.drawString(GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackground() {
|
||||
return "guis/crafting.png";
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import appeng.container.implementations.ContainerWirelessPatternTerminal;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
||||
@@ -30,4 +31,11 @@ public class GuiWirelessPatternTerminal extends GuiPatternTerm {
|
||||
super(inventoryPlayer, te, new ContainerWirelessPatternTerminal(inventoryPlayer, te));
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,17 +20,22 @@ package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.container.implementations.ContainerWirelessTerm;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
||||
public class GuiWirelessTerm extends GuiMEPortableCell {
|
||||
public class GuiWirelessTerm extends GuiMEMonitorable {
|
||||
|
||||
public GuiWirelessTerm(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
|
||||
super(inventoryPlayer, te);
|
||||
public GuiWirelessTerm(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject te) {
|
||||
super(inventoryPlayer, te, new ContainerWirelessTerm(inventoryPlayer, te));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxRows() {
|
||||
return this.defaultGetMaxRows();
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.bindTexture("guis/wirelessupgrades.png");
|
||||
Gui.drawModalRectWithCustomSizedTexture(offsetX + 198, offsetY + 127, 0, 0, 32, 32, 32, 32);
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user