Skip to content

Commit a93613d

Browse files
Copilotrubensworks
andcommitted
Fix slot alignment, add config option, and update translation
- Fix slot positioning: Remove extra Y offset so slots align with GUI borders - Add config option terminalStorageTabEnderChestEnabled to allow disabling the tab - Change translation from "Ender Chest" to "Ender Storage" Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent 86227d9 commit a93613d

5 files changed

Lines changed: 8 additions & 13 deletions

File tree

src/main/java/org/cyclops/integratedterminals/GeneralConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ public class GeneralConfig extends DummyConfig {
9090
public static int guiStorageScaleMaxColumns = 32;
9191
@ConfigurableProperty(category = "general", comment = "If the crafting grid should always be shown centrally, and not be responsive based on screen size.", isCommandable = true, configLocation = ModConfig.Type.CLIENT)
9292
public static boolean guiStorageForceCraftingGridCenter = false;
93+
@ConfigurableProperty(category = "general", comment = "If the Ender Chest tab should be enabled in the storage terminal.", isCommandable = true, configLocation = ModConfig.Type.COMMON)
94+
public static boolean terminalStorageTabEnderChestEnabled = true;
9395

9496
public GeneralConfig() {
9597
super(IntegratedTerminals._instance, "general");

src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabEnderChestClient.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,6 @@ public void setActiveSlotQuantity(int quantity) {
139139
return Collections.emptyList();
140140
}
141141

142-
@Override
143-
public int getSlotOffsetX() {
144-
return 32;
145-
}
146-
147-
@Override
148-
public int getSlotOffsetY() {
149-
return 58; // Adjusted to position the Ender Chest slots properly
150-
}
151-
152142
@Override
153143
public boolean isSlotValidForDraggingInto(int channel, Slot slot) {
154144
// Allow dragging into Ender Chest slots

src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabEnderChestCommon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public List<Pair<Slot, ISlotPositionCallback>> loadSlots(AbstractContainerMenu c
4747
Slot slot = new Slot(player.getEnderChestInventory(), slotIndex, 0, 0);
4848
ISlotPositionCallback positionCallback = (factors) -> {
4949
int x = factors.offsetX() + finalCol * 18;
50-
int y = factors.offsetY() + finalRow * 18 + 18; // Add offset to position below tab area
50+
int y = factors.offsetY() + finalRow * 18;
5151
return Pair.of(x, y);
5252
};
5353

src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabs.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import net.minecraftforge.registries.RegisterEvent;
99
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
1010
import org.cyclops.integrateddynamics.capability.network.PositionedAddonsNetworkIngredientsHandlerConfig;
11+
import org.cyclops.integratedterminals.GeneralConfig;
1112
import org.cyclops.integratedterminals.IntegratedTerminals;
1213
import org.cyclops.integratedterminals.api.terminalstorage.ITerminalStorageTabRegistry;
1314

@@ -42,7 +43,9 @@ public static void afterIngredientComponentsRegistration(RegisterEvent event) {
4243
}
4344

4445
// Add Ender Chest tab
45-
TerminalStorageTabs.REGISTRY.register(new TerminalStorageTabEnderChest());
46+
if (GeneralConfig.terminalStorageTabEnderChestEnabled) {
47+
TerminalStorageTabs.REGISTRY.register(new TerminalStorageTabEnderChest());
48+
}
4649
}
4750
}
4851

src/main/resources/assets/integratedterminals/lang/en_us.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"gui.integratedterminals.terminal_storage.tooltip.fluid.amount": "%s mB",
1212
"gui.integratedterminals.terminal_storage.storage_name": "%s Storage",
1313
"gui.integratedterminals.terminal_storage.crafting_name": "%s Crafting",
14-
"gui.integratedterminals.terminal_storage.ender_chest": "Ender Chest",
14+
"gui.integratedterminals.terminal_storage.ender_chest": "Ender Storage",
1515
"gui.integratedterminals.terminal_storage.channel": "Chan:",
1616
"gui.integratedterminals.terminal_storage.craft": "craft",
1717
"gui.integratedterminals.terminal_storage.tooltip.requirements": "Crafting Requirements:",

0 commit comments

Comments
 (0)