Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-17 05:20:10 +01:00
Ursprung
7a19cb8d04
Commit
0d5661f8a6
@ -8,5 +8,5 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// version must be manually kept in sync with the one in root project settings.gradle.kts
|
||||
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.1")
|
||||
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.2")
|
||||
}
|
||||
|
@ -17,10 +17,8 @@
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets;
|
||||
|
||||
import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.Protocol1_12_2To1_13;
|
||||
import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data.NamedSoundMapping;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.rewriter.RewriterBase;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
@ -39,14 +37,13 @@ public class SoundPackets1_13 extends RewriterBase<Protocol1_12_2To1_13> {
|
||||
protocol.registerClientbound(ClientboundPackets1_13.NAMED_SOUND, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.STRING);
|
||||
handler(wrapper -> {
|
||||
String newSound = wrapper.get(Type.STRING, 0);
|
||||
String oldSound = NamedSoundMapping.getOldId(newSound);
|
||||
if (oldSound != null || (oldSound = protocol.getMappingData().getMappedNamedSound(newSound)) != null) {
|
||||
wrapper.set(Type.STRING, 0, oldSound);
|
||||
} else if (!Via.getConfig().isSuppressConversionWarnings()) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("Unknown named sound in 1.13->1.12 protocol: " + newSound);
|
||||
String sound = wrapper.read(Type.STRING);
|
||||
String mappedSound = NamedSoundMapping.getOldId(sound);
|
||||
if (mappedSound != null || (mappedSound = protocol.getMappingData().getMappedNamedSound(sound)) != null) {
|
||||
wrapper.write(Type.STRING, mappedSound);
|
||||
} else {
|
||||
wrapper.write(Type.STRING, sound);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ dependencyResolutionManagement {
|
||||
pluginManagement {
|
||||
plugins {
|
||||
id("net.kyori.blossom") version "1.2.0"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.1"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren