From fc77530140a14638d1440db68e7e68a2056713a9 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 18 Aug 2024 02:43:07 +0800 Subject: add covers that can hold some items (#2593) * add chest cover * Spotless apply for branch feature/chestcover for #2593 (#2594) * create window on the left * sa * add slot migration * add texture and T2&3 * add texture and T2&3 * spotless * fix bugs * add chest cover * small fix and spotless Co-Authored-By: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz Co-authored-by: Nxer <43300390+Nxer@users.noreply.github.com> Co-authored-by: Nxer <306803661@qq.com> --- src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/util') diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java index c66251439b..f5bd7a92f4 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java @@ -30,6 +30,7 @@ import gregtech.api.GregTech_API; import gregtech.api.gui.GT_GUIColorOverride; import gregtech.api.gui.modularui.GT_CoverUIBuildContext; import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.gui.widgets.GT_CoverTickRateButton; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; @@ -431,9 +432,7 @@ public abstract class GT_CoverBehaviorBase { ModularWindow.Builder builder = ModularWindow.builder(getGUIWidth(), getGUIHeight()); builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); builder.setGuiTint(getUIBuildContext().getGuiColorization()); - if (doesBindPlayerInventory() && !getUIBuildContext().isAnotherWindow()) { - builder.bindPlayerInventory(getUIBuildContext().getPlayer()); - } + maybeBindPlayerInventory(builder); addTitleToUI(builder); addUIWidgets(builder); if (getUIBuildContext().isAnotherWindow()) { @@ -453,6 +452,12 @@ public abstract class GT_CoverBehaviorBase { return builder.build(); } + protected void maybeBindPlayerInventory(ModularWindow.Builder builder) { + if (doesBindPlayerInventory() && !getUIBuildContext().isAnotherWindow()) { + builder.bindPlayerInventory(getUIBuildContext().getPlayer(), 7, GUITextureSet.DEFAULT.getItemSlot()); + } + } + /** * Override this to add widgets for your UI. */ -- cgit