Commit Graph

19 Commits

Author SHA1 Message Date
Nathan V.
df69410e67 (Improvement) Implement playing sound by string ID (#5201)
* (improvement) implement playing sound by string ID

I've replaced enum-based sound playing events with string-based equivalents, which should open the door for server customization and other enhancements in the future

- Added SoundLookup class with different registry lookup methods depending on server version.
- Added the ability to configure what sounds are played depending on event, with a fallback built into SoundType.
- Removed getCrippleSound as SoundLookup can now fall back to the original default sound if the mace sound doesn't exist on the server's Minecraft version.
- Added a EnableCustomSounds config variable that will skip SoundLookup ID checking and just pass the sound string directly to the client, mainly due to the fact that it isn't possible to verify if resource pack values exist.
 - Cleaned up a few switch statements to match how the original getSound had it formatted.

I'd love to see/do a further expansion of sound configuration for each ability now that we can just fall back to generic, but that may be for another PR.

* Fix getIsEnabled using wrong key

* always use registry, simplify custom sound enabling logic, optimize reflection calls

* forgot we need this for legacy versions

---------

Co-authored-by: nossr50 <nossr50@gmail.com>
2025-08-30 11:15:26 -07:00
nossr50
e52371aeb3 formatting applied to most of the source code to tidy things up, and misc refactors 2025-07-03 15:07:31 -07:00
nossr50
bfbefa78f5 fix mace sound on older versions 2025-01-04 13:53:43 -08:00
nossr50
ce18f3df97 major optimizations to getting xp values for specific blocks 2024-11-02 18:56:11 -07:00
Robert Alan Chapton
971e5da0ad Maces (#5035)
Add Maces skill
2024-06-30 15:10:29 -07:00
nossr50
d0ab2bdb2f clean up if/else formatting 2024-05-19 14:09:00 -07:00
nossr50
291effdbc8 if( -> if ( 2024-05-12 14:13:34 -07:00
nossr50
10470dde13 Reduce default volume of level up sound 2021-12-11 21:19:30 -08:00
nossr50
7c6d5c476d Green Thumb requires a hoe, sneak to break with a hoe 2020-02-19 16:14:21 -08:00
nossr50
e2073ff9f7 Immature crop replanting, green thumb tweaks, replant accidental break
protection
2020-02-19 15:58:53 -08:00
nossr50
ac731258c7 Berserk now breaks glass and makes noise when doing so 2020-01-24 01:09:19 -08:00
nossr50
00f5491718 Added many styling options
Improved Smelting Style
You can now add the level required to a skills name in the locale (instructions can be found next to the locale string)
2019-01-28 03:40:32 -08:00
nossr50
11c8374f6c Bleed doesn't suck anymore. 2019-01-21 15:15:10 -08:00
nossr50
b42b4cadbe You can now turn off sound effects used by mcMMO 2019-01-21 05:23:48 -08:00
nossr50
ac4b8068b0 Activating a super ability has a sound, and trying to cut down trees or activate skull splitter when on cooldown also has a sound. 2019-01-20 02:44:18 -08:00
nossr50
b1be43154a Roll & Gracefull Roll have sounds now 2019-01-20 02:23:18 -08:00
nossr50
e962f645b6 Skill Unlock notifications now have sounds 2019-01-20 01:21:33 -08:00
nossr50
6ad9c8e664 Readying a Tool now has a sound 2019-01-20 00:46:33 -08:00
nossr50
85fd0a79bc Sounds volume and pitch are now configurable in the new sounds.yml file 2019-01-12 19:08:54 -08:00