Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-24 23:30:17 +01:00
Ursprung
7a19cb8d04
Commit
0d5661f8a6
@ -8,5 +8,5 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// version must be manually kept in sync with the one in root project settings.gradle.kts
|
// 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;
|
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.Protocol1_12_2To1_13;
|
||||||
import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data.NamedSoundMapping;
|
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.protocol.remapper.PacketRemapper;
|
||||||
import com.viaversion.viaversion.api.rewriter.RewriterBase;
|
import com.viaversion.viaversion.api.rewriter.RewriterBase;
|
||||||
import com.viaversion.viaversion.api.type.Type;
|
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() {
|
protocol.registerClientbound(ClientboundPackets1_13.NAMED_SOUND, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING);
|
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
String newSound = wrapper.get(Type.STRING, 0);
|
String sound = wrapper.read(Type.STRING);
|
||||||
String oldSound = NamedSoundMapping.getOldId(newSound);
|
String mappedSound = NamedSoundMapping.getOldId(sound);
|
||||||
if (oldSound != null || (oldSound = protocol.getMappingData().getMappedNamedSound(newSound)) != null) {
|
if (mappedSound != null || (mappedSound = protocol.getMappingData().getMappedNamedSound(sound)) != null) {
|
||||||
wrapper.set(Type.STRING, 0, oldSound);
|
wrapper.write(Type.STRING, mappedSound);
|
||||||
} else if (!Via.getConfig().isSuppressConversionWarnings()) {
|
} else {
|
||||||
ViaBackwards.getPlatform().getLogger().warning("Unknown named sound in 1.13->1.12 protocol: " + newSound);
|
wrapper.write(Type.STRING, sound);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ dependencyResolutionManagement {
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
plugins {
|
plugins {
|
||||||
id("net.kyori.blossom") version "1.2.0"
|
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