Skip to content

Gate shift-scrolling on the shift_scrollable item tag - #1328

Closed
xm1221 wants to merge 3 commits into
FallingColors:mainfrom
xm1221:main
Closed

xm1221 wants to merge 3 commits into
FallingColors:mainfrom
xm1221:main

Conversation

@xm1221

@xm1221 xm1221 commented Oct 11, 2026 •

Copy link
Copy Markdown

Summary

This pull request is for Almightly Staff. That mod's staff stores pages the same way a spellbook does, but it is not HexItems.SPELLBOOK. Shift-scroll, the spellbook keybinds, and the scroll wheel inside the casting grid ignore it, because those paths compare the item by identity. Hex Spell Wheel can list the staff's pages and then sends MsgShiftScrollC2S; the server drops that packet, so selecting a page does nothing. Reported in Almightly Staff #1.

Rather than keep a second scroll listener inside Almightly Staff, this lets any such item opt into the existing Hex path.

The new item tag is hexcasting:shift_scrollable. The spellbook and the abacus are both in it by default, so their current behavior is unchanged. Almightly Staff adds its staff to the tag from its own datapack. Other mods can do the same.

  • The client treats every item in the tag as shift-scrollable. The abacus still uses the abacus invert setting. Every other entry uses the spellbook invert setting.
  • The server still handles HexItems.ABACUS with the abacus logic. Any other stack in the tag uses the spellbook page logic (ItemSpellbook.rotatePageIdx).
  • The packet format is unchanged.

Test plan

  • Shift-scroll a spellbook in the main hand and the offhand, including the invert-scroll option
  • Shift-scroll an abacus in either hand, including Ctrl for the larger step
  • Flip pages with the spellbook previous/next keybinds
  • Scroll pages inside the casting grid
  • With Almightly Staff installed, shift-scroll its staff and select a page from Hex Spell Wheel
  • Confirm an item that is not in the tag still does not scroll

由于笔者英文水平不足,本文由grok4.7生成,我很抱歉。
The author's English is limited, so this text was generated by Grok 4.7. Apologies.

Shift-scroll, the spellbook keybinds, and the casting grid only matched the vanilla spellbook, so addons that extend ItemSpellbook could not change pages.
The spellbook and the abacus are both in the tag. Other items opt in through the tag instead of subclassing ItemSpellbook.
@Robotgiggle

Copy link
Copy Markdown
Member

Closed in favor of #1329, which provides an alternate fix for the problem described here.

@github-project-automation github-project-automation Bot moved this from 📋 Backlog to ✅ Done in Hex Casting Oct 13, 2026
hexxy-weblate pushed a commit to hexxy-weblate/HexMod that referenced this pull request Oct 13, 2026
A slightly more robust solution to the problem described in FallingColors#1328,
namely that the shift-scrolling mechanics currently do not work on
anything other than spellbooks even if the item in question provides all
the right NBT (or even if it directly extends ItemSpellbook).

FallingColors#1328 resolved the problem by adding a new item tag - here, I've simply
changed the code that previously checked "is this item a spellbook" to
instead check "does this item have the `page_idx` and `page_names` NBT
tags". This means you can simply apply those NBT tags to any item to
allow shift-scrolling it.

This is also in line with the general idea of 1.21's item components,
where simply attaching the component to an item is enough to apply the
relevant functionality to that item, without having to manually
implement it.

<img width="460" height="200" alt="2026-10-11_15 48 50"
src="https://github.com/user-attachments/assets/fecec52e-2677-436b-84ad-37d1f4495d42"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants