mirror of
https://github.com/BluTac10/Xbox-Neo.git
synced 2026-06-17 15:42:05 +00:00
fix: beacon menu item consumption, data sync, and button state issues
- Prevent payment item from being consumed when submitting unchanged powers - Reorder ServerPlayer::openBeacon to send ContainerOpenPacket before addSlotListener so beacon data packets arrive after the client menu is ready - Add BeaconMenu::broadcastChanges() to continuously sync levels and powers to clients, matching the pattern FurnaceMenu already uses - Initialize UIControl_BeaconEffectButton::m_lastState to prevent stale heap memory from suppressing Iggy ChangeState calls on menu re-entry
This commit is contained in:
@@ -1431,7 +1431,6 @@ bool ServerPlayer::openBeacon(shared_ptr<BeaconTileEntity> beacon)
|
||||
nextContainerCounter();
|
||||
containerMenu = new BeaconMenu(inventory, beacon);
|
||||
containerMenu->containerId = containerCounter;
|
||||
containerMenu->addSlotListener(this);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (FourKitBridge::FireInventoryOpen(entityId, ContainerOpenPacket::BEACON, beacon->getCustomName(), beacon->getContainerSize()))
|
||||
{
|
||||
@@ -1439,7 +1438,10 @@ bool ServerPlayer::openBeacon(shared_ptr<BeaconTileEntity> beacon)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
// Send the open packet BEFORE addSlotListener so the client has the
|
||||
// menu ready when the beacon data (levels, powers) arrives.
|
||||
connection->send(std::make_shared<ContainerOpenPacket>(containerCounter, ContainerOpenPacket::BEACON, beacon->getCustomName(), beacon->getContainerSize(), beacon->hasCustomName()));
|
||||
containerMenu->addSlotListener(this);
|
||||
refreshContainer(containerMenu);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user