Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-09-08 13:52:50 +02:00
Change read method type in update score packet
Dieser Commit ist enthalten in:
Ursprung
70645ec5ee
Commit
5c8c589a40
@ -23,6 +23,7 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.viaversion.viaversion.api.Via;
|
import com.viaversion.viaversion.api.Via;
|
||||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
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.Position;
|
||||||
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13;
|
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13;
|
||||||
import com.viaversion.viaversion.api.minecraft.item.DataItem;
|
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.BlockConnectionStorage;
|
||||||
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
|
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.protocols.protocol1_13to1_12_2.storage.TabCompleteTracker;
|
||||||
import com.viaversion.viaversion.api.minecraft.ClientWorld;
|
|
||||||
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
||||||
import com.viaversion.viaversion.util.ChatColorUtil;
|
import com.viaversion.viaversion.util.ChatColorUtil;
|
||||||
import com.viaversion.viaversion.util.GsonUtil;
|
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
|
String displayName = wrapper.read(Type.STRING); // Display Name
|
||||||
displayName = rewriteTeamMemberName(displayName);
|
displayName = rewriteTeamMemberName(displayName);
|
||||||
wrapper.write(Type.STRING, 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);
|
componentRewriter.registerTitle(ClientboundPackets1_12_1.TITLE);
|
||||||
|
@ -79,7 +79,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
|||||||
registerClientbound(ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
|
registerClientbound(ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
|
||||||
wrapper.passthrough(Type.STRING); // Owner
|
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);
|
final String objectiveName = wrapper.read(Type.STRING);
|
||||||
|
|
||||||
if (action == 1) { // Reset score
|
if (action == 1) { // Reset score
|
||||||
|
@ -157,7 +157,7 @@ public final class ComponentConverter {
|
|||||||
return listTag;
|
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")
|
// Lists are only used for lists of components ("extra" and "with")
|
||||||
final ListTag processedListTag = new ListTag();
|
final ListTag processedListTag = new ListTag();
|
||||||
for (final JsonElement entry : array) {
|
for (final JsonElement entry : array) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren