3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-20 06:50:10 +01:00

23w46a (mostly)

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-11-19 16:48:24 +01:00
Ursprung 995c0bf4c3
Commit 8f5683f764
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
4 geänderte Dateien mit 42 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -34,6 +34,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.data.entity.EntityTrackerBase;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.rewriter.CommandRewriter1_19_4;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2;
@ -42,6 +43,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3;
import com.viaversion.viaversion.rewriter.ComponentRewriter.ReadType; import com.viaversion.viaversion.rewriter.ComponentRewriter.ReadType;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import java.util.BitSet; import java.util.BitSet;
public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundPackets1_20_3, ClientboundPackets1_20_2, ServerboundPackets1_20_3, ServerboundPackets1_20_2> { public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundPackets1_20_3, ClientboundPackets1_20_2, ServerboundPackets1_20_3, ServerboundPackets1_20_2> {
@ -64,6 +66,44 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
soundRewriter.registerEntitySound(ClientboundPackets1_20_3.ENTITY_SOUND); soundRewriter.registerEntitySound(ClientboundPackets1_20_3.ENTITY_SOUND);
soundRewriter.registerStopSound(ClientboundPackets1_20_3.STOP_SOUND); soundRewriter.registerStopSound(ClientboundPackets1_20_3.STOP_SOUND);
new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.STATISTICS);
new CommandRewriter1_19_4<ClientboundPackets1_20_3>(this) {
@Override
public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception {
if (argumentType.equals("minecraft:style")) {
wrapper.write(Type.VAR_INT, 1); // Phrase
} else {
super.handleArgument(wrapper, argumentType);
}
}
}.registerDeclareCommands1_19(ClientboundPackets1_20_3.DECLARE_COMMANDS);
registerClientbound(ClientboundPackets1_20_3.RESET_SCORE, ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
wrapper.passthrough(Type.STRING); // Owner
wrapper.write(Type.BYTE, (byte) 1); // Reset score
wrapper.passthrough(Type.STRING); // Objective name
});
registerClientbound(ClientboundPackets1_20_3.UPDATE_SCORE, wrapper -> {
wrapper.passthrough(Type.STRING); // Owner
wrapper.write(Type.BYTE, (byte) 0); // Change score
wrapper.passthrough(Type.STRING); // Objective name
wrapper.passthrough(Type.VAR_INT); // Score
// Remove display and number format
wrapper.clearInputBuffer();
});
registerClientbound(ClientboundPackets1_20_3.SCOREBOARD_OBJECTIVE, wrapper -> {
wrapper.passthrough(Type.STRING); // Objective Name
final byte action = wrapper.passthrough(Type.BYTE); // Method
if (action == 0 || action == 2) {
convertComponent(wrapper); // Display Name
wrapper.passthrough(Type.VAR_INT); // Render type
// Remove number format
wrapper.clearInputBuffer();
}
});
cancelClientbound(ClientboundPackets1_20_3.TICKING_STATE); cancelClientbound(ClientboundPackets1_20_3.TICKING_STATE);
cancelClientbound(ClientboundPackets1_20_3.TICKING_STEP); cancelClientbound(ClientboundPackets1_20_3.TICKING_STEP);
@ -173,13 +213,6 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
convertComponent(wrapper); // Sender convertComponent(wrapper); // Sender
convertOptionalComponent(wrapper); // Target convertOptionalComponent(wrapper); // Target
}); });
registerClientbound(ClientboundPackets1_20_3.SCOREBOARD_OBJECTIVE, wrapper -> {
wrapper.passthrough(Type.STRING); // Objective Name
final byte action = wrapper.passthrough(Type.BYTE); // Mode
if (action == 0 || action == 2) {
convertComponent(wrapper); // Display Name
}
});
registerClientbound(ClientboundPackets1_20_3.TEAMS, wrapper -> { registerClientbound(ClientboundPackets1_20_3.TEAMS, wrapper -> {
wrapper.passthrough(Type.STRING); // Team Name wrapper.passthrough(Type.STRING); // Team Name
final byte action = wrapper.passthrough(Type.BYTE); // Mode final byte action = wrapper.passthrough(Type.BYTE); // Mode

Datei anzeigen

@ -1,4 +1,4 @@
projectVersion=4.9.0-23w45a-SNAPSHOT projectVersion=4.9.0-23w46a-SNAPSHOT
# Smile emoji # Smile emoji
mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10 mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10

Datei anzeigen

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions] [versions]
# ViaVersion # ViaVersion
viaver = "4.9.0-23w45a-SNAPSHOT" viaver = "4.9.0-23w46a-SNAPSHOT"
# Common provided # Common provided
netty = "4.0.20.Final" netty = "4.0.20.Final"