Pneumatic Helmet : Sound glitch with Charging Station
Sewef opened this issue ยท 6 comments
For feature requests, just erase this template and clearly describe the feature you'd like to see
Minecraft Version 1.12.2
Forge Version 2655
Mod Version 181
Describe your problem, including steps to reproduce it
Opening the Charging Station GUI with any Pneumatic Helmet Module (tested with Block Tracker, Entity Tracker, Item Search Upgrade, Coordinate Tracker Upgrade) will loop a PNC sound while you stay in the interface.
Yeah, I'd actually noticed that in the past, but not all the time. I'll see if I can track it down...
It's happening because of Minecraft item-equip sounds. They're played when an item is placed into a slot - the client plays the sound when it gets a "set slot" packet.
Problem is, when the charging station GUI is open, and the worn helmet's pressure is slowly changing (air draining), then the equipped helmet itemstack in the head slot is changing, which means the "set slot" packet is constantly being sent to the client... and you get an equipping sound effect looped.
Looking for a workaround/fix now.
Looking through the Minecraft code, I can't see a way of suppressing this, other than to give the Pneumatic Helmet a material with an empty item-equip sound effect. Whenever the helmet's NBT changes (i.e. when its stored air drains), the armor wrapper updates the stack in the armor slot in the charging station GUI, causing a "set slot" packet to be sent to the client, and that always causes the item-equip sound to be played.
Maybe play the sound at the beginning of the helmet loading (this progress bar on the screen) instead of playing on equip ?