Drop any namespace for incoming sounds

Fixes custom sounds defined through a resource pack.
This commit is contained in:
Redned 2023-06-04 22:40:09 -05:00 committed by GitHub
parent 246ebddc78
commit 23cdde5cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,9 +78,9 @@ public final class SoundUtils {
}
private static String trim(String identifier) {
// Drop the Minecraft namespace if applicable
if (identifier.startsWith("minecraft:")) {
return identifier.substring("minecraft:".length());
// Drop any namespace if applicable
if (identifier.contains(":") {
return identifier.split(":")[1];
}
return identifier;
}