Skip to content

Fix tracker bar not loading music roll when inserted via automation#97

Open
DJCheesusReal wants to merge 1 commit into
CSOS-Team:1.21-neoforgefrom
DJCheesusReal:fix/tracker-bar-automation
Open

Fix tracker bar not loading music roll when inserted via automation#97
DJCheesusReal wants to merge 1 commit into
CSOS-Team:1.21-neoforgefrom
DJCheesusReal:fix/tracker-bar-automation

Conversation

@DJCheesusReal
Copy link
Copy Markdown

@DJCheesusReal DJCheesusReal commented May 17, 2026

Description

Fixes #96

When a music roll is inserted into a tracker bar through automation (hopper/funnel), the sequencer never loads the song and the GUI buttons stay greyed out because \onContentsChanged()\ did not trigger \onRollChanged().

Changes

  1. TrackerBarInventory.onContentsChanged: Now calls \be.onRollChanged()\ when the inventory changes on the server side
  2. write(): Now persists \buttonsEnabled\ in NBT so it survives chunk reloads
  3. read(): Now restores \buttonsEnabled\ from NBT and reloads the roll via \onRollChanged()\ when the block entity is read

These are the same changes I described in the issue.

When a music roll is inserted into a tracker bar through automation
(e.g. hopper/funnel), the sequencer never loads the song because
onContentsChanged did not trigger onRollChanged().

This commit:
- Calls onRollChanged() from onContentsChanged on the server side
- Persists buttonsEnabled in NBT so it survives chunk reloads
- Reloads the roll via onRollChanged() when the block entity is read from NBT

Fixes CSOS-Team#96
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