Skip to content

Add ender-upgradable storage terminals with an ender chest tab - #213

Open
rubensworks wants to merge 1 commit into
master-1.21-ltsfrom
feature/ender-storage-terminal
Open

Add ender-upgradable storage terminals with an ender chest tab#213
rubensworks wants to merge 1 commit into
master-1.21-ltsfrom
feature/ender-storage-terminal

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Reworked and completed version of #191, targeting master-1.21-lts.
That PR targeted master-1.19-lts and used pre-1.21 APIs (NBT tags instead of data components, old ResourceLocation constructors, ...), so this is a fresh implementation rather than an upmerge, keeping the original intent.

Closes #177

What it does

Storage terminals can be ender-upgraded by right-clicking them with an Eye of Ender, which unlocks an additional Ender Storage tab that exposes the player's ender chest inventory.

  • The eye of ender is consumed, and given back when the terminal is broken.
  • Ender-upgraded terminals emit ender particles, so they can be told apart at a glance.
  • Portable storage terminals are ender-upgraded by combining them with an eye of ender in a crafting grid. The network link and all other stored settings are retained.
  • The upgrade flag is stored in the part state for the part, and in a new integratedterminals:ender_upgraded boolean data component for the item.
  • The whole feature can be disabled with the new terminalStorageTabEnderChestEnabled server config option.

Changes compared to #191

  • Ported to 1.21 APIs (data components, HolderLookup.Provider, ItemStack.is, ...).
  • Shift-clicking works. Rather than reimplementing stack merging inside the client tab, tabs can now apply regular container quick move semantics through the new ITerminalStorageTabCommon#handleQuickMove, which ContainerTerminalStorageBase#quickMoveStack calls for the selected tab before falling back to the ingredient-based quick move handling.
  • Search field, channel label + field, and variable filter slots are hidden on the ender chest tab, through the new hasSearchField(), hasChannelField() and hasVariableFilterSlots() defaults on ITerminalStorageTabClient. The search field placeholder box is simply not drawn for such tabs, so no separate gui texture is needed.
  • Ender particles are implemented, spawned server-side from the part's update tick.
  • The ender chest slots only accept interaction while the terminal is actually ender-upgraded, and the tab is only shown then. The slots are always created, so that slot indices stay identical between client and server regardless of the upgrade state.
  • The ender chest tab is registered through the new ITerminalStorageTabRegistry#registerLast, because AttachCapabilitiesEventIngredientComponent is fired once per ingredient component, which would otherwise place this tab in-between the ingredient component tabs.
  • Crafting recipe, advancement, infobook manual section and infobook tutorial added.

Documentation

  • Manual: Terminals -> Storage Terminal -> Ender Storage
  • Tutorial: Terminal Tutorials -> Ender-upgraded Storage Terminal
  • Advancement: integratedterminals:storage_terminal_ender/ender_upgrade_storage_terminal, triggered by the new integratedterminals:terminal_storage_ender_upgraded criterion when a terminal is ender-upgraded by right-clicking it with an eye of ender.

Only en_us.json was updated, as requested.

Testing

./gradlew build and ./gradlew runGameTestServer pass (30 game tests, 6 of them new).

New game tests cover the upgrade interaction, the eye of ender drop, tab availability before/after upgrading, shift-clicking into and out of the ender chest, the crafting recipe (including network link retention and refusing to upgrade twice), and the new advancement (positive and negative).

Everything was also verified in a dev client: placing and upgrading a terminal, the particles next to a vanilla ender chest for comparison, the tab layout with and without the hidden gui elements, shift-clicking and normal clicking in the ender slots (verified against the player's server-side EnderItems), the portable terminal upgrade recipe and its gui, the advancement unlocking, and the new infobook pages.

Note

While testing the infobook I ran into an unrelated pre-existing CyclopsCore crash: RecipeAppendix#renderToolTips calls renderTooltip on item/fluid buttons of empty recipe slots, whose element is null and whose position was never updated, so they sit at (0, 0). Hovering the top-left 16x16 pixels of the screen while any recipe appendix with an empty slot is shown throws an NPE in renderItemTooltip/renderFluidTooltip. This reproduces on existing pages (e.g. the Drying Basin appendices in the Storage Terminal crafting section), so it is not caused by this PR, but it may be worth fixing in CyclopsCore.


Generated by Claude Code

Storage terminals can be ender-upgraded by right-clicking them with an
eye of ender, which unlocks an additional Ender Storage tab that exposes
the player's ender chest inventory. Portable storage terminals can be
ender-upgraded by combining them with an eye of ender in a crafting grid,
which retains the network they were linked to.

Ender-upgraded terminals emit ender particles, and give back the eye of
ender when they are broken.

The ender chest tab uses regular container slots, so it has no channel
selector, search field or variable filter slots. Tabs can now hide those
via ITerminalStorageTabClient, and can apply regular quick move semantics
via ITerminalStorageTabCommon#handleQuickMove.

Based on the work in #191.

Closes #177

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kzc5LxSaedCXCK4pynhJV3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant