From e09fc05ba2da5b86480538a9e60d61e971b5bf16 Mon Sep 17 00:00:00 2001 From: Andrei Laiff Date: Sun, 22 Oct 2023 21:50:46 +0300 Subject: [PATCH 1/4] Fix `zIndexes` for compatability with `DuraDisplay` --- dependencies.gradle | 39 +++++- .../client/gui/GuiInterfaceWireless.java | 64 ++++++---- .../github/client/gui/GuiLevelMaintainer.java | 24 ++-- .../github/client/gui/GuiLevelTerminal.java | 119 +++++++++++++----- .../container/ContainerLevelMaintainer.java | 4 +- ...iHandler.java => AE2FC_NEIGuiHandler.java} | 12 +- .../glodblock/github/nei/NEI_FC_Config.java | 2 +- 7 files changed, 187 insertions(+), 77 deletions(-) rename src/main/java/com/glodblock/github/nei/{NEIGuiHandler.java => AE2FC_NEIGuiHandler.java} (53%) diff --git a/dependencies.gradle b/dependencies.gradle index 6a5b5413..8b4be9f4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,5 +1,38 @@ -// Add your dependencies here - +/* + * Add your dependencies here. Supported configurations: + * - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod + * Available at runtime and compiletime for mods depending on this mod + * - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API + * Available at runtime but not compiletime for mods depending on this mod + * - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods + * Not available at all for mods depending on this mod, only visible at compiletime for this mod + * - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod + * Available at compiletime but not runtime for mods depending on this mod + * - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency + * Not available at all for mods depending on this mod, only visible at runtime for this mod + * - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime, + * but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing + * - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime + * Available at runtime for mods depending on this mod + * - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry + * - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main + * + * - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name + * Requires you to enable usesShadowedDependencies in gradle.properties + * + * - compile("g:n:v:c"): deprecated, replace with "api" (works like the old "compile") or "implementation" (can be more efficient) + * + * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed, + * but use this sparingly as it can break using your mod as another mod's dependency if you're not careful. + * + * To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven, + * or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file. + * + * Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not. + * The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published. + * + * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph + */ dependencies { api('com.github.GTNewHorizons:NotEnoughItems:2.4.5-GTNH:dev') api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-268-GTNH-pre:dev') @@ -22,4 +55,6 @@ dependencies { compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.13-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:GTplusplus:1.10.17:dev') { transitive = false } compileOnly("com.github.GTNewHorizons:Hodgepodge:2.3.14:dev") { transitive = false } + + runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.1.7:dev") } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java index 047ac54b..cbb4731c 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java @@ -100,11 +100,13 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText * Z-level Map (FLOATS) 0.0 - BACKGROUND 1.0 - ItemStacks 2.0 - Slot color overlays 20.0 - ItemStack overlays 21.0 - * Slot mouse hover overlay 200.0 - Tooltips */ - private static final float ITEMSTACK_Z = 1.0f; + private static final float ITEM_STACK_Z = 100.0f; private static final float SLOT_Z = 0.5f; - private static final float ITEMSTACK_OVERLAY_Z = 20.0f; - private static final float SLOT_HOVER_Z = 31.0f; - private static final float TOOLTIP_Z = 200.0f; + private static final float ITEM_STACK_OVERLAY_Z = 200.0f; + private static final float SLOT_HOVER_Z = 310.0f; + private static final float TOOLTIP_Z = 210.0f; + private static final float STEP_Z = 10.0f; + private static final float MAGIC_RENDER_ITEM_Z = 50.0f; protected int offsetY; @@ -409,31 +411,19 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText /* * Render title */ - GL11.glTranslatef(0.0f, 0.0f, 50f); bindTexture(BACKGROUND); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z); if (sectionBottom > 0 && sectionBottom < IfaceSection.TITLE_HEIGHT) { /* Transition draw */ - drawTexturedModalRect( - 0, - 0, - VIEW_LEFT, - HEADER_HEIGHT + IfaceSection.TITLE_HEIGHT - sectionBottom, - VIEW_WIDTH, - sectionBottom); - fontRendererObj.drawString(section.name, 2, sectionBottom - IfaceSection.TITLE_HEIGHT + 2, fontColor); title = sectionBottom; } else if (viewY < 0) { /* Hidden title draw */ - drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); - fontRendererObj.drawString(section.name, 2, 2, fontColor); title = 0; } else { /* Normal title draw */ - drawTexturedModalRect(0, viewY, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); - fontRendererObj.drawString(section.name, 2, viewY + 2, fontColor); title = 0; } - GL11.glTranslatef(0.0f, 0.0f, -50f); + GL11.glTranslatef(0.0f, 0.0f, -(ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z)); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); Iterator visible = section.getVisible(); @@ -451,6 +441,32 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText entry.optionsButton.yPosition = -1; } } + bindTexture(BACKGROUND); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z); + if (sectionBottom > 0 && sectionBottom < IfaceSection.TITLE_HEIGHT) { + /* Transition draw */ + drawTexturedModalRect( + 0, + 0, + VIEW_LEFT, + HEADER_HEIGHT + IfaceSection.TITLE_HEIGHT - sectionBottom, + VIEW_WIDTH, + sectionBottom); + fontRendererObj.drawString(section.name, 2, sectionBottom - IfaceSection.TITLE_HEIGHT + 2, fontColor); + } else if (viewY < 0) { + /* Hidden title draw */ + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glTranslatef(0.0f, 0.0f, 100f); + drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); + fontRendererObj.drawString(section.name, 2, 2, fontColor); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } else { + /* Normal title draw */ + drawTexturedModalRect(0, viewY, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); + fontRendererObj.drawString(section.name, 2, viewY + 2, fontColor); + } + GL11.glTranslatef(0.0f, 0.0f, -(ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z)); + return IfaceSection.TITLE_HEIGHT + renderY; } @@ -538,23 +554,23 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText final ItemStack toRender = iep.getOutput(stack); GL11.glPushMatrix(); - GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEMSTACK_Z); + GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_Z); GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting(); - translatedRenderItem.zLevel = 3.0f - 50.0f; + translatedRenderItem.zLevel = ITEM_STACK_Z - MAGIC_RENDER_ITEM_Z; translatedRenderItem .renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), toRender, 0, 0); - GL11.glTranslatef(0.0f, 0.0f, ITEMSTACK_OVERLAY_Z - ITEMSTACK_Z); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z); aeRenderItem.setAeStack(AEItemStack.create(toRender)); aeRenderItem.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), toRender, 0, 0); aeRenderItem.zLevel = 0.0f; RenderHelper.disableStandardItemLighting(); if (!tooltip) { if (entry.brokenRecipes[slotIdx]) { - GL11.glTranslatef(0.0f, 0.0f, SLOT_Z - ITEMSTACK_OVERLAY_Z); + GL11.glTranslatef(0.0f, 0.0f, SLOT_Z - ITEM_STACK_OVERLAY_Z); drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayInvalid.getColor()); } else if (entry.filteredRecipes[slotIdx]) { - GL11.glTranslatef(0.0f, 0.0f, ITEMSTACK_OVERLAY_Z); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z); drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor()); } } else { @@ -563,7 +579,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText GL11.glPopMatrix(); } else if (entry.filteredRecipes[slotIdx]) { GL11.glPushMatrix(); - GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEMSTACK_OVERLAY_Z); + GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_OVERLAY_Z); drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor()); GL11.glPopMatrix(); } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java b/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java index 742d6d1f..fb290f8a 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java @@ -263,19 +263,6 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler { } } this.input = null; - for (int i = 0; i < this.cont.getRequestSlots().length; i++) { - SlotFluidConvertingFake slot = this.cont.getRequestSlots()[i]; - ItemStack currentStack = this.cont.getPlayerInv().getItemStack(); - if (getSlotArea(slot).contains(xCoord, yCoord) && currentStack != null) { - ItemStack itemStack = createLevelValues(currentStack.copy()); - itemStack.getTagCompound().setInteger(TLMTags.Index.tagName, i); - slot.putStack(itemStack); - NetworkHandler.instance.sendToServer(new PacketNEIDragClick(itemStack, slot.getSlotIndex())); - this.updateAmount(slot.getSlotIndex(), itemStack.stackSize); - return; - } - } - } super.mouseClicked(xCoord, yCoord, btn); } @@ -370,6 +357,17 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler { if (draggedStack != null) { draggedStack.stackSize = 0; } + for (int i = 0; i < this.cont.getRequestSlots().length; i++) { + SlotFluidConvertingFake slot = this.cont.getRequestSlots()[i]; + if (getSlotArea(slot).contains(mouseX, mouseY) && draggedStack != null) { + ItemStack itemStack = createLevelValues(draggedStack.copy()); + itemStack.getTagCompound().setInteger(TLMTags.Index.tagName, i); + slot.putStack(itemStack); + NetworkHandler.instance.sendToServer(new PacketNEIDragClick(itemStack, slot.getSlotIndex())); + this.updateAmount(slot.getSlotIndex(), itemStack.stackSize); + return true; + } + } return false; } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java index 023e0aa1..b95799cd 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java @@ -81,6 +81,7 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.tile.inventory.AppEngInternalInventory; import appeng.util.Platform; +import appeng.util.ReadableNumberConverter; import appeng.util.item.AEItemStack; import cpw.mods.fml.common.Loader; @@ -114,11 +115,13 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel // private GuiFCImgButton modeSwitchEdit; private final LevelTerminalList masterList = new LevelTerminalList(); private final List extraOptionsText = new ArrayList<>(2); - private static final float ITEM_STACK_Z = 1.0f; + private static final float ITEM_STACK_Z = 100.0f; private static final float SLOT_Z = 0.5f; - private static final float ITEM_STACK_OVERLAY_Z = 20.0f; - private static final float SLOT_HOVER_Z = 31.0f; - private static final float TOOLTIP_Z = 200.0f; + private static final float ITEM_STACK_OVERLAY_Z = 200.0f; + private static final float SLOT_HOVER_Z = 310.0f; + private static final float TOOLTIP_Z = 210.0f; + private static final float STEP_Z = 10.0f; + private static final float MAGIC_RENDER_ITEM_Z = 50.0f; public GuiLevelTerminal(InventoryPlayer inventoryPlayer, Container container) { super(inventoryPlayer, container); @@ -440,32 +443,14 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel /* * Render title */ - GL11.glTranslatef(0.0f, 0.0f, 50f); mc.getTextureManager().bindTexture(TEX_BG); if (sectionBottom > 0 && sectionBottom < LevelTerminalSection.TITLE_HEIGHT) { - /* Transition draw */ - drawTexturedModalRect( - 0, - 0, - VIEW_LEFT, - HEADER_HEIGHT + LevelTerminalSection.TITLE_HEIGHT - sectionBottom, - VIEW_WIDTH, - sectionBottom); - fontRendererObj - .drawString(section.name, 2, sectionBottom - LevelTerminalSection.TITLE_HEIGHT + 2, fontColor); title = sectionBottom; } else if (viewY < 0) { - /* Hidden title draw */ - drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, LevelTerminalSection.TITLE_HEIGHT); - fontRendererObj.drawString(section.name, 2, 2, fontColor); title = 0; } else { - /* Normal title draw */ - drawTexturedModalRect(0, viewY, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, LevelTerminalSection.TITLE_HEIGHT); - fontRendererObj.drawString(section.name, 2, viewY + 2, fontColor); title = 0; } - GL11.glTranslatef(0.0f, 0.0f, -50f); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); Iterator visible = section.getVisible(); @@ -485,6 +470,36 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel entry.configButton.yPosition = -1; } } + /* + * Render title + */ + mc.getTextureManager().bindTexture(TEX_BG); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z); + if (sectionBottom > 0 && sectionBottom < LevelTerminalSection.TITLE_HEIGHT) { + /* Transition draw */ + drawTexturedModalRect( + 0, + 0, + VIEW_LEFT, + HEADER_HEIGHT + LevelTerminalSection.TITLE_HEIGHT - sectionBottom, + VIEW_WIDTH, + sectionBottom); + fontRendererObj + .drawString(section.name, 2, sectionBottom - LevelTerminalSection.TITLE_HEIGHT + 2, fontColor); + } else if (viewY < 0) { + /* Hidden title draw */ + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glTranslatef(0.0f, 0.0f, 100f); + drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, LevelTerminalSection.TITLE_HEIGHT); + fontRendererObj.drawString(section.name, 2, 2, fontColor); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } else { + /* Normal title draw */ + drawTexturedModalRect(0, viewY, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, LevelTerminalSection.TITLE_HEIGHT); + fontRendererObj.drawString(section.name, 2, viewY + 2, fontColor); + } + GL11.glTranslatef(0.0f, 0.0f, -(ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z)); + return LevelTerminalSection.TITLE_HEIGHT + renderY; } @@ -583,21 +598,13 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_Z); GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting(); - aeItemStack.setStackSize(1); - aeRenderItem.setAeStack(aeItemStack); - aeRenderItem.zLevel = 3.0f - 50.0f; - aeRenderItem.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, 0); - aeRenderItem.zLevel = 0.0f; - GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z); + itemStack.stackSize = 1; aeItemStack.setStackSize(quantity); aeRenderItem.setAeStack(aeItemStack); + aeRenderItem.zLevel = ITEM_STACK_Z - MAGIC_RENDER_ITEM_Z; + aeRenderItem.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, 0); aeRenderItem.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, 0); - if (batch > 0) { - aeItemStack.setStackSize(batch); - aeRenderItem.setAeStack(aeItemStack); - aeRenderItem - .renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, -11); - } + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z); int color = switch (state) { case Idle -> FCGuiColors.StateIdle.getColor(); case Craft -> FCGuiColors.StateCraft.getColor(); @@ -608,6 +615,11 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel int offset = 0; int size = 4; drawRect(offset, offset, offset + size, offset + size, color); + GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z); + this.drawReadableAmount(fontRendererObj, quantity, 16.0f, 12f, 16777215); + if (batch > 0) { + this.drawReadableAmount(fontRendererObj, batch, 16.0f, 1f, 16777215); + } RenderHelper.disableStandardItemLighting(); /* @@ -645,6 +657,45 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel return relY + 1; } + public void drawReadableAmount(final FontRenderer fontRenderer, long amount, float x, float y, int color) { + + final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; + final float inverseScaleFactor = 1.0f / scaleFactor; + final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1; + final boolean unicodeFlag = fontRenderer.getUnicodeFlag(); + final String stackSize = this.getToBeRenderedStackSize(amount); + + fontRenderer.setUnicodeFlag(false); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glPushMatrix(); + GL11.glScaled(scaleFactor, scaleFactor, scaleFactor); + + final int X = (int) (((float) x + offset - fontRenderer.getStringWidth(stackSize) * scaleFactor) + * inverseScaleFactor); + final int Y = (int) (((float) y + offset * scaleFactor) * inverseScaleFactor); + + fontRenderer.drawString(stackSize, X + 1, Y, 0); + fontRenderer.drawString(stackSize, X - 1, Y, 0); + fontRenderer.drawString(stackSize, X, Y + 1, 0); + fontRenderer.drawString(stackSize, X, Y - 1, 0); + + fontRenderer.drawString(stackSize, X, Y, color); + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + + fontRenderer.setUnicodeFlag(unicodeFlag); + } + + private String getToBeRenderedStackSize(final long originalSize) { + if (AEConfig.instance.useTerminalUseLargeFont()) { + return ReadableNumberConverter.INSTANCE.toSlimReadableForm(originalSize); + } else { + return ReadableNumberConverter.INSTANCE.toWideReadableForm(originalSize); + } + } + @SuppressWarnings("unchecked") @Override public void drawHoveringText(List textLines, int x, int y, FontRenderer font) { diff --git a/src/main/java/com/glodblock/github/client/gui/container/ContainerLevelMaintainer.java b/src/main/java/com/glodblock/github/client/gui/container/ContainerLevelMaintainer.java index 9e3962d9..d8882f98 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/ContainerLevelMaintainer.java +++ b/src/main/java/com/glodblock/github/client/gui/container/ContainerLevelMaintainer.java @@ -135,10 +135,10 @@ public class ContainerLevelMaintainer extends AEBaseContainer { data.setTag(TLMTags.Stack.tagName, itemStackTag); } if (!data.hasKey(TLMTags.Quantity.tagName)) { - data.setLong(TLMTags.Quantity.tagName, itemStack.stackSize); + data.setLong(TLMTags.Quantity.tagName, itemStack.stackSize > 0 ? itemStack.stackSize : 1); } if (!data.hasKey(TLMTags.Batch.tagName)) { - data.setLong(TLMTags.Batch.tagName, 0); + data.setLong(TLMTags.Batch.tagName, 1); } if (!data.hasKey(TLMTags.Enable.tagName)) { data.setBoolean(TLMTags.Enable.tagName, false); diff --git a/src/main/java/com/glodblock/github/nei/NEIGuiHandler.java b/src/main/java/com/glodblock/github/nei/AE2FC_NEIGuiHandler.java similarity index 53% rename from src/main/java/com/glodblock/github/nei/NEIGuiHandler.java rename to src/main/java/com/glodblock/github/nei/AE2FC_NEIGuiHandler.java index e2c87620..0aaa48e4 100644 --- a/src/main/java/com/glodblock/github/nei/NEIGuiHandler.java +++ b/src/main/java/com/glodblock/github/nei/AE2FC_NEIGuiHandler.java @@ -1,13 +1,15 @@ package com.glodblock.github.nei; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; import com.glodblock.github.client.gui.GuiFluidMonitor; import com.glodblock.github.client.gui.GuiItemMonitor; +import com.glodblock.github.client.gui.GuiLevelMaintainer; import codechicken.nei.api.INEIGuiAdapter; -public class NEIGuiHandler extends INEIGuiAdapter { +public class AE2FC_NEIGuiHandler extends INEIGuiAdapter { @Override public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { @@ -18,4 +20,12 @@ public class NEIGuiHandler extends INEIGuiAdapter { } return false; } + + @Override + public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, ItemStack draggedStack, int button) { + if (gui instanceof GuiLevelMaintainer guiLevelMaintainer) { + return guiLevelMaintainer.handleDragNDrop(gui, mouseX, mouseY, draggedStack, button); + } + return super.handleDragNDrop(gui, mouseX, mouseY, draggedStack, button); + } } diff --git a/src/main/java/com/glodblock/github/nei/NEI_FC_Config.java b/src/main/java/com/glodblock/github/nei/NEI_FC_Config.java index 7779686a..3f08bc67 100644 --- a/src/main/java/com/glodblock/github/nei/NEI_FC_Config.java +++ b/src/main/java/com/glodblock/github/nei/NEI_FC_Config.java @@ -17,7 +17,7 @@ public class NEI_FC_Config implements IConfigureNEI { @Override public void loadConfig() { - API.registerNEIGuiHandler(new NEIGuiHandler()); + API.registerNEIGuiHandler(new AE2FC_NEIGuiHandler()); API.addSearchProvider(new NEIItemFilter()); API.registerStackStringifyHandler(new FCStackStringifyHandler()); From f76e053167e5fa8c8f3dce15c87803b6b9cc6037 Mon Sep 17 00:00:00 2001 From: Andrei Laiff Date: Sun, 22 Oct 2023 22:51:40 +0300 Subject: [PATCH 2/4] Update AE2 and fix compatability --- dependencies.gradle | 2 +- .../client/gui/GuiInterfaceWireless.java | 143 ++++++++++-------- .../glodblock/github/proxy/CommonProxy.java | 6 +- 3 files changed, 82 insertions(+), 69 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 8b4be9f4..7a501588 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,7 +35,7 @@ */ dependencies { api('com.github.GTNewHorizons:NotEnoughItems:2.4.5-GTNH:dev') - api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-268-GTNH-pre:dev') + api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-271-GTNH-pre:dev') api('curse.maven:cofh-core-69162:2388751') api('com.github.GTNewHorizons:waila:1.6.0:dev') api("com.github.GTNewHorizons:WirelessCraftingTerminal:1.10.1:dev") diff --git a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java index cbb4731c..ec7c7388 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java @@ -58,7 +58,7 @@ import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.core.localization.PlayerMessages; import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketIfaceTermUpdate; +import appeng.core.sync.packets.PacketInterfaceTerminalUpdate; import appeng.core.sync.packets.PacketInventoryAction; import appeng.helpers.InventoryAction; import appeng.helpers.PatternHelper; @@ -80,7 +80,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText AppEng.MOD_ID, "textures/guis/newinterfaceterminal.png"); - private final IfaceList masterList = new IfaceList(); + private final InterfaceWirelessList masterList = new InterfaceWirelessList(); private final MEGuiTextField searchFieldOutputs; private final MEGuiTextField searchFieldInputs; private final MEGuiTextField searchFieldNames; @@ -329,7 +329,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText offsetY + HEADER_HEIGHT + viewHeight + 1, 0.0f, 0.0f, - (HEADER_HEIGHT + IfaceSection.TITLE_HEIGHT + 1.0f) / 256.0f, + (HEADER_HEIGHT + InterfaceWirelessSection.TITLE_HEIGHT + 1.0f) / 256.0f, this.xSize / 256.0f, (HEADER_HEIGHT + 106.0f) / 256.0f); Tessellator.instance.draw(); @@ -361,7 +361,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText final int scroll = this.getScrollBar().getCurrentScroll(); int viewY = -scroll; // current y in viewport coordinates int entryIdx = 0; - List visibleSections = this.masterList.getVisibleSections(); + List visibleSections = this.masterList.getVisibleSections(); final float guiScaleX = (float) mc.displayWidth / width; final float guiScaleY = (float) mc.displayHeight / height; @@ -376,7 +376,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText * Render each section */ while (viewY < this.viewHeight && entryIdx < visibleSections.size()) { - IfaceSection section = visibleSections.get(entryIdx); + InterfaceWirelessSection section = visibleSections.get(entryIdx); int sectionHeight = section.getHeight(); /* Is it viewable/in the viewport at all? */ @@ -403,7 +403,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText * @param relMouseY transformed mouse coords relative to viewport * @return the height of the section rendered in viewport coordinates, max of viewHeight. */ - private int drawSection(IfaceSection section, int viewY, int relMouseX, int relMouseY) { + private int drawSection(InterfaceWirelessSection section, int viewY, int relMouseX, int relMouseY) { int title; int renderY = 0; final int sectionBottom = viewY + section.getHeight() - 1; @@ -413,7 +413,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText */ bindTexture(BACKGROUND); GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z); - if (sectionBottom > 0 && sectionBottom < IfaceSection.TITLE_HEIGHT) { + if (sectionBottom > 0 && sectionBottom < InterfaceWirelessSection.TITLE_HEIGHT) { /* Transition draw */ title = sectionBottom; } else if (viewY < 0) { @@ -426,48 +426,55 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText GL11.glTranslatef(0.0f, 0.0f, -(ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z)); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - Iterator visible = section.getVisible(); + Iterator visible = section.getVisible(); while (visible.hasNext()) { if (viewY < viewHeight) { renderY += drawEntry( visible.next(), - viewY + IfaceSection.TITLE_HEIGHT + renderY, + viewY + InterfaceWirelessSection.TITLE_HEIGHT + renderY, title, relMouseX, relMouseY); } else { - IfaceEntry entry = visible.next(); + InerfaceWirelessEntry entry = visible.next(); entry.dispY = -9999; entry.optionsButton.yPosition = -1; } } bindTexture(BACKGROUND); GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z); - if (sectionBottom > 0 && sectionBottom < IfaceSection.TITLE_HEIGHT) { + if (sectionBottom > 0 && sectionBottom < InterfaceWirelessSection.TITLE_HEIGHT) { /* Transition draw */ drawTexturedModalRect( 0, 0, VIEW_LEFT, - HEADER_HEIGHT + IfaceSection.TITLE_HEIGHT - sectionBottom, + HEADER_HEIGHT + InterfaceWirelessSection.TITLE_HEIGHT - sectionBottom, VIEW_WIDTH, sectionBottom); - fontRendererObj.drawString(section.name, 2, sectionBottom - IfaceSection.TITLE_HEIGHT + 2, fontColor); + fontRendererObj + .drawString(section.name, 2, sectionBottom - InterfaceWirelessSection.TITLE_HEIGHT + 2, fontColor); } else if (viewY < 0) { /* Hidden title draw */ GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glTranslatef(0.0f, 0.0f, 100f); - drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); + drawTexturedModalRect(0, 0, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, InterfaceWirelessSection.TITLE_HEIGHT); fontRendererObj.drawString(section.name, 2, 2, fontColor); GL11.glEnable(GL11.GL_DEPTH_TEST); } else { /* Normal title draw */ - drawTexturedModalRect(0, viewY, VIEW_LEFT, HEADER_HEIGHT, VIEW_WIDTH, IfaceSection.TITLE_HEIGHT); + drawTexturedModalRect( + 0, + viewY, + VIEW_LEFT, + HEADER_HEIGHT, + VIEW_WIDTH, + InterfaceWirelessSection.TITLE_HEIGHT); fontRendererObj.drawString(section.name, 2, viewY + 2, fontColor); } GL11.glTranslatef(0.0f, 0.0f, -(ITEM_STACK_OVERLAY_Z + ITEM_STACK_Z + STEP_Z)); - return IfaceSection.TITLE_HEIGHT + renderY; + return InterfaceWirelessSection.TITLE_HEIGHT + renderY; } /** @@ -475,7 +482,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText * * @param viewY the gui coordinate z */ - private int drawEntry(IfaceEntry entry, int viewY, int titleBottom, int relMouseX, int relMouseY) { + private int drawEntry(InerfaceWirelessEntry entry, int viewY, int titleBottom, int relMouseX, int relMouseY) { bindTexture(BACKGROUND); Tessellator.instance.startDrawingQuads(); int relY = 0; @@ -518,7 +525,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } toRender.drawButton(mc, relMouseX, relMouseY); if (toRender.getMouseIn() - && relMouseY >= Math.max(IfaceSection.TITLE_HEIGHT, entry.optionsButton.yPosition)) { + && relMouseY >= Math.max(InterfaceWirelessSection.TITLE_HEIGHT, entry.optionsButton.yPosition)) { // draw a tooltip GL11.glTranslatef(0f, 0f, TOOLTIP_Z); GL11.glDisable(GL11.GL_SCISSOR_TEST); @@ -547,7 +554,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText ItemStack stack = inv.getStackInSlot(slotIdx); boolean tooltip = relMouseX > colLeft - 1 && relMouseX < colRight - 1 - && relMouseY >= Math.max(viewY + rowYTop, IfaceSection.TITLE_HEIGHT) + && relMouseY >= Math.max(viewY + rowYTop, InterfaceWirelessSection.TITLE_HEIGHT) && relMouseY < Math.min(viewY + rowYBot, viewHeight); if (stack != null) { final ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem(); @@ -773,32 +780,38 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText return false; } - public void postUpdate(List updates, int statusFlags) { - if ((statusFlags & PacketIfaceTermUpdate.CLEAR_ALL_BIT) == PacketIfaceTermUpdate.CLEAR_ALL_BIT) { + public void postUpdate(List updates, int statusFlags) { + if ((statusFlags & PacketInterfaceTerminalUpdate.CLEAR_ALL_BIT) + == PacketInterfaceTerminalUpdate.CLEAR_ALL_BIT) { /* Should clear all client entries. */ this.masterList.list.clear(); } /* Should indicate disconnected, so the terminal turns dark. */ - this.online = (statusFlags & PacketIfaceTermUpdate.DISCONNECT_BIT) != PacketIfaceTermUpdate.DISCONNECT_BIT; + this.online = (statusFlags & PacketInterfaceTerminalUpdate.DISCONNECT_BIT) + != PacketInterfaceTerminalUpdate.DISCONNECT_BIT; - for (PacketIfaceTermUpdate.PacketEntry cmd : updates) { + for (PacketInterfaceTerminalUpdate.PacketEntry cmd : updates) { parsePacketCmd(cmd); } this.masterList.markDirty(); } - private void parsePacketCmd(PacketIfaceTermUpdate.PacketEntry cmd) { + private void parsePacketCmd(PacketInterfaceTerminalUpdate.PacketEntry cmd) { long id = cmd.entryId; - if (cmd instanceof PacketIfaceTermUpdate.PacketAdd addCmd) { - IfaceEntry entry = new IfaceEntry(id, addCmd.name, addCmd.rows, addCmd.rowSize, addCmd.online) - .setLocation(addCmd.x, addCmd.y, addCmd.z, addCmd.dim, addCmd.side) - .setIcons(addCmd.selfRep, addCmd.dispRep).setItems(addCmd.items); + if (cmd instanceof PacketInterfaceTerminalUpdate.PacketAdd addCmd) { + InerfaceWirelessEntry entry = new InerfaceWirelessEntry( + id, + addCmd.name, + addCmd.rows, + addCmd.rowSize, + addCmd.online).setLocation(addCmd.x, addCmd.y, addCmd.z, addCmd.dim, addCmd.side) + .setIcons(addCmd.selfRep, addCmd.dispRep).setItems(addCmd.items); masterList.addEntry(entry); - } else if (cmd instanceof PacketIfaceTermUpdate.PacketRemove) { + } else if (cmd instanceof PacketInterfaceTerminalUpdate.PacketRemove) { masterList.removeEntry(id); - } else if (cmd instanceof PacketIfaceTermUpdate.PacketOverwrite owCmd) { - IfaceEntry entry = masterList.list.get(id); + } else if (cmd instanceof PacketInterfaceTerminalUpdate.PacketOverwrite owCmd) { + InerfaceWirelessEntry entry = masterList.list.get(id); if (entry == null) { return; @@ -816,8 +829,8 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } } masterList.isDirty = true; - } else if (cmd instanceof PacketIfaceTermUpdate.PacketRename renameCmd) { - IfaceEntry entry = masterList.list.get(id); + } else if (cmd instanceof PacketInterfaceTerminalUpdate.PacketRename renameCmd) { + InerfaceWirelessEntry entry = masterList.list.get(id); if (entry != null) { if (StatCollector.canTranslate(renameCmd.newName)) { @@ -910,16 +923,16 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText /** * Tracks the list of entries. */ - private class IfaceList { + private class InterfaceWirelessList { - private final Map list = new HashMap<>(); - private final Map sections = new TreeMap<>(); - private final List visibleSections = new ArrayList<>(); + private final Map list = new HashMap<>(); + private final Map sections = new TreeMap<>(); + private final List visibleSections = new ArrayList<>(); private boolean isDirty; private int height; - private IfaceEntry hoveredEntry; + private InerfaceWirelessEntry hoveredEntry; - IfaceList() { + InterfaceWirelessList() { this.isDirty = true; } @@ -930,7 +943,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText height = 0; visibleSections.clear(); - for (IfaceSection section : sections.values()) { + for (InterfaceWirelessSection section : sections.values()) { String query = GuiInterfaceWireless.this.searchFieldNames.getText(); if (!query.isEmpty() && !section.name.toLowerCase().contains(query.toLowerCase())) { continue; @@ -982,7 +995,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } else { int y = 0; - for (IfaceSection section : sections) { + for (InterfaceWirelessSection section : sections) { if (y > viewY) { result = true; scrollbar.setCurrentScroll(y); @@ -994,11 +1007,11 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText return result; } - public void addEntry(IfaceEntry entry) { - IfaceSection section = sections.get(entry.dispName); + public void addEntry(InerfaceWirelessEntry entry) { + InterfaceWirelessSection section = sections.get(entry.dispName); if (section == null) { - section = new IfaceSection(entry.dispName); + section = new InterfaceWirelessSection(entry.dispName); sections.put(entry.dispName, section); } section.addEntry(entry); @@ -1007,14 +1020,14 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } public void removeEntry(long id) { - IfaceEntry entry = list.remove(id); + InerfaceWirelessEntry entry = list.remove(id); if (entry != null) { entry.section.removeEntry(entry); } } - public List getVisibleSections() { + public List getVisibleSections() { if (isDirty) { update(); } @@ -1032,7 +1045,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText if (relMouseX < 0 || relMouseX >= VIEW_WIDTH || relMouseY < 0 || relMouseY >= viewHeight) { return false; } - for (IfaceSection section : getVisibleSections()) { + for (InterfaceWirelessSection section : getVisibleSections()) { if (section.mouseClicked(relMouseX, relMouseY, btn)) { return true; } @@ -1044,13 +1057,13 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText /** * A section holds all the interface entries with the same name. */ - private class IfaceSection { + private class InterfaceWirelessSection { public static final int TITLE_HEIGHT = 12; String name; - List entries = new ArrayList<>(); - Set visibleEntries = new TreeSet<>(Comparator.comparing(e -> { + List entries = new ArrayList<>(); + Set visibleEntries = new TreeSet<>(Comparator.comparing(e -> { if (e.dispRep != null) { return e.dispRep.getDisplayName() + e.id; } else { @@ -1061,7 +1074,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText private boolean isDirty = true; boolean visible = false; - IfaceSection(String name) { + InterfaceWirelessSection(String name) { this.name = name; } @@ -1081,7 +1094,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText height = 0; } else { height = TITLE_HEIGHT; - for (IfaceEntry entry : visibleEntries) { + for (InerfaceWirelessEntry entry : visibleEntries) { height += entry.guiHeight; } } @@ -1093,7 +1106,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText String input = GuiInterfaceWireless.this.searchFieldInputs.getText().toLowerCase(); String output = GuiInterfaceWireless.this.searchFieldOutputs.getText().toLowerCase(); - for (IfaceEntry entry : entries) { + for (InerfaceWirelessEntry entry : entries) { var moleAss = AEApi.instance().definitions().blocks().molecularAssembler().maybeStack(1); entry.dispY = -9999; if (onlyMolecularAssemblers @@ -1132,19 +1145,19 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } } - public void addEntry(IfaceEntry entry) { + public void addEntry(InerfaceWirelessEntry entry) { this.entries.add(entry); entry.section = this; this.isDirty = true; } - public void removeEntry(IfaceEntry entry) { + public void removeEntry(InerfaceWirelessEntry entry) { this.entries.remove(entry); entry.section = null; this.isDirty = true; } - public Iterator getVisible() { + public Iterator getVisible() { if (isDirty) { update(); } @@ -1152,7 +1165,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } public boolean mouseClicked(int relMouseX, int relMouseY, int btn) { - Iterator it = getVisible(); + Iterator it = getVisible(); boolean ret = false; while (it.hasNext() && !ret) { @@ -1166,7 +1179,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText /** * This class keeps track of an entry and its widgets. */ - private class IfaceEntry { + private class InerfaceWirelessEntry { String dispName; AppEngInternalInventory inv; @@ -1177,7 +1190,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText ItemStack selfRep; /** Nullable - icon that represents the interface's "target" */ ItemStack dispRep; - IfaceSection section; + InterfaceWirelessSection section; long id; int x, y, z, dim, side; int rows, rowSize; @@ -1191,7 +1204,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText boolean[] filteredRecipes; private int hoveredSlotIdx = -1; - IfaceEntry(long id, String name, int rows, int rowSize, boolean online) { + InerfaceWirelessEntry(long id, String name, int rows, int rowSize, boolean online) { this.id = id; if (StatCollector.canTranslate(name)) { this.dispName = StatCollector.translateToLocal(name); @@ -1216,7 +1229,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText this.filteredRecipes = new boolean[rows * rowSize]; } - IfaceEntry setLocation(int x, int y, int z, int dim, int side) { + InerfaceWirelessEntry setLocation(int x, int y, int z, int dim, int side) { this.x = x; this.y = y; this.z = z; @@ -1226,7 +1239,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText return this; } - IfaceEntry setIcons(ItemStack selfRep, ItemStack dispRep) { + InerfaceWirelessEntry setIcons(ItemStack selfRep, ItemStack dispRep) { // Kotlin would make this pretty easy :( this.selfRep = selfRep; this.dispRep = dispRep; @@ -1246,7 +1259,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText this.guiHeight = 18 * rows + 4; } - IfaceEntry setItems(NBTTagList items) { + InerfaceWirelessEntry setItems(NBTTagList items) { assert items.tagCount() == inv.getSizeInventory(); for (int i = 0; i < items.tagCount(); ++i) { @@ -1286,7 +1299,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText return false; } if (mouseX >= optionsButton.xPosition && mouseX < 2 + optionsButton.width - && mouseY > Math.max(optionsButton.yPosition, IfaceSection.TITLE_HEIGHT) + && mouseY > Math.max(optionsButton.yPosition, InterfaceWirelessSection.TITLE_HEIGHT) && mouseY <= Math.min(optionsButton.yPosition + optionsButton.height, viewHeight)) { optionsButton.func_146113_a(mc.getSoundHandler()); DimensionalCoord blockPos = new DimensionalCoord(x, y, z, dim); @@ -1327,7 +1340,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText int offsetY = mouseY - dispY; int offsetX = mouseX - (VIEW_WIDTH - rowSize * 18) - 1; if (offsetX >= 0 && offsetX < (rowSize * 18) - && mouseY > Math.max(dispY, IfaceSection.TITLE_HEIGHT) + && mouseY > Math.max(dispY, InterfaceWirelessSection.TITLE_HEIGHT) && offsetY < Math.min(viewHeight - dispY, guiHeight)) { final int col = offsetX / 18; final int row = offsetY / 18; diff --git a/src/main/java/com/glodblock/github/proxy/CommonProxy.java b/src/main/java/com/glodblock/github/proxy/CommonProxy.java index 1c3d1ead..42e3e3bb 100644 --- a/src/main/java/com/glodblock/github/proxy/CommonProxy.java +++ b/src/main/java/com/glodblock/github/proxy/CommonProxy.java @@ -65,9 +65,9 @@ public class CommonProxy { Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_EXPORT_BUS), 1); } AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AEFluidInterfaceHandler()); - AEApi.instance().registries().ifaceTerm().register(PartFluidP2PInterface.class); - AEApi.instance().registries().ifaceTerm().register(PartFluidInterface.class); - AEApi.instance().registries().ifaceTerm().register(TileFluidInterface.class); + AEApi.instance().registries().interfaceTerminal().register(PartFluidP2PInterface.class); + AEApi.instance().registries().interfaceTerminal().register(PartFluidInterface.class); + AEApi.instance().registries().interfaceTerminal().register(TileFluidInterface.class); } public void registerRenderers() {} From 3a87975b7cfdd658d5e972333070e535ccbee75b Mon Sep 17 00:00:00 2001 From: Andrei Laiff Date: Mon, 23 Oct 2023 15:31:20 +0300 Subject: [PATCH 3/4] Change `ForgeDirection` side serialization to `byte` --- .../glodblock/github/network/SPacketLevelTerminalUpdate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glodblock/github/network/SPacketLevelTerminalUpdate.java b/src/main/java/com/glodblock/github/network/SPacketLevelTerminalUpdate.java index b02016c5..515278f3 100644 --- a/src/main/java/com/glodblock/github/network/SPacketLevelTerminalUpdate.java +++ b/src/main/java/com/glodblock/github/network/SPacketLevelTerminalUpdate.java @@ -269,7 +269,7 @@ public class SPacketLevelTerminalUpdate implements IMessage { buf.writeInt(y); buf.writeInt(z); buf.writeInt(dim); - buf.writeInt(side); + buf.writeByte(side); buf.writeInt(rows); buf.writeInt(rowSize); @@ -302,7 +302,7 @@ public class SPacketLevelTerminalUpdate implements IMessage { this.y = buf.readInt(); this.z = buf.readInt(); this.dim = buf.readInt(); - this.side = buf.readInt(); + this.side = buf.readByte(); this.rows = buf.readInt(); this.rowSize = buf.readInt(); int payloadSize = buf.readInt(); From 8d8b7d0c43540e08bbf67000a34e5606b3705989 Mon Sep 17 00:00:00 2001 From: Andrei Laiff Date: Mon, 23 Oct 2023 16:31:06 +0300 Subject: [PATCH 4/4] Fix tooltip zIndexes --- .../com/glodblock/github/client/gui/GuiInterfaceWireless.java | 2 +- .../java/com/glodblock/github/client/gui/GuiLevelTerminal.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java index ec7c7388..b586c87d 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java @@ -104,7 +104,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText private static final float SLOT_Z = 0.5f; private static final float ITEM_STACK_OVERLAY_Z = 200.0f; private static final float SLOT_HOVER_Z = 310.0f; - private static final float TOOLTIP_Z = 210.0f; + private static final float TOOLTIP_Z = 410.0f; private static final float STEP_Z = 10.0f; private static final float MAGIC_RENDER_ITEM_Z = 50.0f; diff --git a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java index b95799cd..6f34df8c 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java @@ -119,7 +119,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel private static final float SLOT_Z = 0.5f; private static final float ITEM_STACK_OVERLAY_Z = 200.0f; private static final float SLOT_HOVER_Z = 310.0f; - private static final float TOOLTIP_Z = 210.0f; + private static final float TOOLTIP_Z = 410.0f; private static final float STEP_Z = 10.0f; private static final float MAGIC_RENDER_ITEM_Z = 50.0f;