aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2024-08-18 02:43:07 +0800
committerGitHub <noreply@github.com>2024-08-17 18:43:07 +0000
commitfc77530140a14638d1440db68e7e68a2056713a9 (patch)
tree7d0f6817e8d447fd6ca73dbfbbe49421a1b79b7e /src/main/java/gregtech/api
parentb11f636564c23ceead60854fce444816f31f4bd4 (diff)
downloadGT5-Unofficial-fc77530140a14638d1440db68e7e68a2056713a9.tar.gz
GT5-Unofficial-fc77530140a14638d1440db68e7e68a2056713a9.tar.bz2
GT5-Unofficial-fc77530140a14638d1440db68e7e68a2056713a9.zip
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 <dream-master@gmx.net> Co-authored-by: Nxer <43300390+Nxer@users.noreply.github.com> Co-authored-by: Nxer <306803661@qq.com>
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/ItemList.java3
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java7
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java11
3 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java
index 6533aca304..d26f4bef15 100644
--- a/src/main/java/gregtech/api/enums/ItemList.java
+++ b/src/main/java/gregtech/api/enums/ItemList.java
@@ -592,6 +592,9 @@ public enum ItemList implements IItemContainer {
Cover_SolarPanel_UHV,
Cover_SolarPanel_UEV,
Cover_SolarPanel_UIV,
+ Cover_Chest_Basic,
+ Cover_Chest_Good,
+ Cover_Chest_Advanced,
Ingot_IridiumAlloy,
Plank_Oak,
Plank_Spruce,
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 53125ec454..618fc83c55 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -538,6 +538,13 @@ public class Textures {
OVERLAY_FLUIDDETECTOR,
OVERLAY_ITEMDETECTOR,
+ OVERLAY_COVER_CHEST_1,
+ OVERLAY_COVER_CHEST_1_OPENED,
+ OVERLAY_COVER_CHEST_2,
+ OVERLAY_COVER_CHEST_2_OPENED,
+ OVERLAY_COVER_CHEST_3,
+ OVERLAY_COVER_CHEST_3_OPENED,
+
OVERLAY_REDSTONE_TRANSMITTER,
OVERLAY_REDSTONE_RECEIVER,
OVERLAY_MAINTENANCE_DETECTOR,
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<T extends ISerializableObject> {
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<T extends ISerializableObject> {
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.
*/