3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Change read method type in update score packet

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-13 12:06:44 +01:00
Ursprung 70645ec5ee
Commit 5c8c589a40
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
3 geänderte Dateien mit 3 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -23,6 +23,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.ClientWorld;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
@ -59,7 +60,6 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.Player
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockConnectionStorage;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.TabCompleteTracker;
import com.viaversion.viaversion.api.minecraft.ClientWorld;
import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.util.ChatColorUtil;
import com.viaversion.viaversion.util.GsonUtil;
@ -499,13 +499,6 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol<ClientboundPackets1_1
String displayName = wrapper.read(Type.STRING); // Display Name
displayName = rewriteTeamMemberName(displayName);
wrapper.write(Type.STRING, displayName);
byte action = wrapper.read(Type.BYTE);
wrapper.write(Type.BYTE, action);
wrapper.passthrough(Type.STRING); // Objective Name
if (action != 1) {
wrapper.passthrough(Type.VAR_INT); // Value
}
});
componentRewriter.registerTitle(ClientboundPackets1_12_1.TITLE);

Datei anzeigen

@ -79,7 +79,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
registerClientbound(ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
wrapper.passthrough(Type.STRING); // Owner
final byte action = wrapper.read(Type.BYTE);
final int action = wrapper.read(Type.VAR_INT);
final String objectiveName = wrapper.read(Type.STRING);
if (action == 1) { // Reset score

Datei anzeigen

@ -157,7 +157,7 @@ public final class ComponentConverter {
return listTag;
}
// Generally, vanilla-esque serializers should not produce this format, so it should be rare
// Generally, modern vanilla-esque serializers should not produce this format, so it should be rare
// Lists are only used for lists of components ("extra" and "with")
final ListTag processedListTag = new ListTag();
for (final JsonElement entry : array) {