mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-23 15:00:37 +01:00
This commit is contained in:
parent
0e3e2d0e28
commit
d1357df8f5
1 changed files with 2 additions and 11 deletions
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.util;
|
package org.geysermc.geyser.util;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.level.sound.BuiltinSound;
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.level.sound.Sound;
|
import com.github.steveice10.mc.protocol.data.game.level.sound.Sound;
|
||||||
import org.cloudburstmc.math.vector.Vector3f;
|
import org.cloudburstmc.math.vector.Vector3f;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.LevelEvent;
|
import org.cloudburstmc.protocol.bedrock.data.LevelEvent;
|
||||||
|
@ -66,9 +65,7 @@ public final class SoundUtils {
|
||||||
* @return a Bedrock sound
|
* @return a Bedrock sound
|
||||||
*/
|
*/
|
||||||
public static String translatePlaySound(String javaIdentifier) {
|
public static String translatePlaySound(String javaIdentifier) {
|
||||||
javaIdentifier = trim(javaIdentifier);
|
SoundMapping soundMapping = Registries.SOUNDS.get(trim(javaIdentifier));
|
||||||
|
|
||||||
SoundMapping soundMapping = Registries.SOUNDS.get(javaIdentifier);
|
|
||||||
if (soundMapping == null || soundMapping.getPlaysound() == null) {
|
if (soundMapping == null || soundMapping.getPlaysound() == null) {
|
||||||
// no mapping
|
// no mapping
|
||||||
GeyserImpl.getInstance().getLogger().debug("[PlaySound] Defaulting to sound server gave us for " + javaIdentifier);
|
GeyserImpl.getInstance().getLogger().debug("[PlaySound] Defaulting to sound server gave us for " + javaIdentifier);
|
||||||
|
@ -104,13 +101,7 @@ public final class SoundUtils {
|
||||||
* @param pitch the pitch
|
* @param pitch the pitch
|
||||||
*/
|
*/
|
||||||
public static void playSound(GeyserSession session, Sound javaSound, Vector3f position, float volume, float pitch) {
|
public static void playSound(GeyserSession session, Sound javaSound, Vector3f position, float volume, float pitch) {
|
||||||
String packetSound;
|
String packetSound = javaSound.getName();
|
||||||
if (!(javaSound instanceof BuiltinSound)) {
|
|
||||||
// Identifier needs trimmed probably.
|
|
||||||
packetSound = trim(javaSound.getName());
|
|
||||||
} else {
|
|
||||||
packetSound = javaSound.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
SoundMapping soundMapping = Registries.SOUNDS.get(packetSound);
|
SoundMapping soundMapping = Registries.SOUNDS.get(packetSound);
|
||||||
if (soundMapping == null) {
|
if (soundMapping == null) {
|
||||||
|
|
Loading…
Reference in a new issue