PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Pneumatic Helmet : Sound glitch with Charging Station

Sewef opened this issue ยท 6 comments

commented

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.

commented

Yeah, I'd actually noticed that in the past, but not all the time. I'll see if I can track it down...

commented

Fixed in 0.6.4 release

commented

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.

commented

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.

commented

Maybe play the sound at the beginning of the helmet loading (this progress bar on the screen) instead of playing on equip ?

commented

With the way Minecraft & Forge are currently written, that's not possible. However, I've found a better workaround (it occurred to me that the normal player inventory window displays armor items and doesn't have this issue, so I'm borrowing that code :)