Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2025-01-12 07:56:15 +01:00
Ursprung
27f7c3e72b
Commit
a982d8c0f0
@ -21,6 +21,10 @@ public class SoundRewriter extends us.myles.ViaVersion.api.rewriters.SoundRewrit
|
||||
map(Type.STRING); // Sound identifier
|
||||
handler(wrapper -> {
|
||||
String soundId = wrapper.get(Type.STRING, 0);
|
||||
if (soundId.startsWith("minecraft:")) {
|
||||
soundId = soundId.substring(10);
|
||||
}
|
||||
|
||||
String mappedId = protocol.getMappingData().getMappedNamedSound(soundId);
|
||||
if (mappedId == null) return;
|
||||
if (!mappedId.isEmpty()) {
|
||||
@ -46,6 +50,10 @@ public class SoundRewriter extends us.myles.ViaVersion.api.rewriters.SoundRewrit
|
||||
}
|
||||
|
||||
String soundId = wrapper.read(Type.STRING);
|
||||
if (soundId.startsWith("minecraft:")) {
|
||||
soundId = soundId.substring(10);
|
||||
}
|
||||
|
||||
String mappedId = protocol.getMappingData().getMappedNamedSound(soundId);
|
||||
if (mappedId == null) {
|
||||
// No mapping found
|
||||
|
@ -25,6 +25,10 @@ public class SoundPackets1_13 extends Rewriter<Protocol1_12_2To1_13> {
|
||||
map(Type.STRING);
|
||||
handler(wrapper -> {
|
||||
String newSound = wrapper.get(Type.STRING, 0);
|
||||
if (newSound.startsWith("minecraft:")) {
|
||||
newSound = newSound.substring(10);
|
||||
}
|
||||
|
||||
String oldSound = NamedSoundMapping.getOldId(newSound);
|
||||
if (oldSound != null || (oldSound = protocol.getMappingData().getMappedNamedSound(newSound)) != null) {
|
||||
wrapper.set(Type.STRING, 0, oldSound);
|
||||
@ -51,7 +55,12 @@ public class SoundPackets1_13 extends Rewriter<Protocol1_12_2To1_13> {
|
||||
|
||||
String sound;
|
||||
if ((flags & 0x02) != 0) {
|
||||
sound = protocol.getMappingData().getMappedNamedSound(wrapper.read(Type.STRING));
|
||||
String newSound = wrapper.read(Type.STRING);
|
||||
if (newSound.startsWith("minecraft:")) {
|
||||
newSound = newSound.substring(10);
|
||||
}
|
||||
|
||||
sound = protocol.getMappingData().getMappedNamedSound(newSound);
|
||||
if (sound == null) {
|
||||
sound = "";
|
||||
}
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren