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
1 changed files with 3 additions and 3 deletions

View File

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