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

Update Via usage

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-10 12:15:35 +01:00
Ursprung 7b8fd2b061
Commit b09950dc64
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
5 geänderte Dateien mit 13 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -67,7 +67,7 @@ import java.util.logging.Logger;
public interface ViaBackwardsPlatform {
String MINIMUM_VV_VERSION = "4.9.0";
String MINIMUM_VV_VERSION = "4.9.3";
/**
* Initialize ViaBackwards.

Datei anzeigen

@ -32,7 +32,6 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.UUIDIntArrayType;
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_15;
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_16;
import com.viaversion.viaversion.libs.gson.JsonElement;
@ -50,6 +49,7 @@ import com.viaversion.viaversion.rewriter.BlockRewriter;
import com.viaversion.viaversion.rewriter.RecipeRewriter;
import com.viaversion.viaversion.util.CompactArrayUtil;
import com.viaversion.viaversion.util.Key;
import com.viaversion.viaversion.util.UUIDUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -257,7 +257,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
if (!(targetUuidTag instanceof IntArrayTag)) return;
// Target -> target_uuid
UUID targetUuid = UUIDIntArrayType.uuidFromIntArray((int[]) targetUuidTag.getValue());
UUID targetUuid = UUIDUtil.fromIntArray((int[]) targetUuidTag.getValue());
tag.put("target_uuid", new StringTag(targetUuid.toString()));
} else if (id.equals("minecraft:skull")) {
Tag skullOwnerTag = tag.remove("SkullOwner");
@ -266,7 +266,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
CompoundTag skullOwnerCompoundTag = (CompoundTag) skullOwnerTag;
Tag ownerUuidTag = skullOwnerCompoundTag.remove("Id");
if (ownerUuidTag instanceof IntArrayTag) {
UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray((int[]) ownerUuidTag.getValue());
UUID ownerUuid = UUIDUtil.fromIntArray((int[]) ownerUuidTag.getValue());
skullOwnerCompoundTag.put("Id", new StringTag(ownerUuid.toString()));
}
@ -298,7 +298,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
CompoundTag ownerCompundTag = (CompoundTag) ownerTag;
Tag idTag = ownerCompundTag.get("Id");
if (idTag instanceof IntArrayTag) {
UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray((int[]) idTag.getValue());
UUID ownerUuid = UUIDUtil.fromIntArray((int[]) idTag.getValue());
ownerCompundTag.put("Id", new StringTag(ownerUuid.toString()));
}
}
@ -340,7 +340,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
Tag idTag = ownerCompundTag.get("Id");
if (idTag instanceof StringTag) {
UUID ownerUuid = UUID.fromString((String) idTag.getValue());
ownerCompundTag.put("Id", new IntArrayTag(UUIDIntArrayType.uuidToIntArray(ownerUuid)));
ownerCompundTag.put("Id", new IntArrayTag(UUIDUtil.toIntArray(ownerUuid)));
}
}
}

Datei anzeigen

@ -47,10 +47,10 @@ import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundConfigurationPackets1_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.util.ComponentConverter;
import com.viaversion.viaversion.rewriter.ComponentRewriter.ReadType;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter;
import java.util.BitSet;
import java.util.UUID;
@ -368,13 +368,13 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
private void convertComponent(final PacketWrapper wrapper) throws Exception {
final Tag tag = wrapper.read(Type.TAG);
translatableRewriter.processTag(tag);
wrapper.write(Type.COMPONENT, Protocol1_20_3To1_20_2.tagComponentToJson(tag));
wrapper.write(Type.COMPONENT, ComponentConverter.tagComponentToJson(tag));
}
private void convertOptionalComponent(final PacketWrapper wrapper) throws Exception {
final Tag tag = wrapper.read(Type.OPTIONAL_TAG);
translatableRewriter.processTag(tag);
wrapper.write(Type.OPTIONAL_COMPONENT, Protocol1_20_3To1_20_2.tagComponentToJson(tag));
wrapper.write(Type.OPTIONAL_COMPONENT, ComponentConverter.tagComponentToJson(tag));
}
@Override

Datei anzeigen

@ -32,8 +32,8 @@ import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_20_2;
import com.viaversion.viaversion.api.type.types.version.Types1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.util.ComponentConverter;
public final class EntityPacketRewriter1_20_3 extends EntityRewriter<ClientboundPackets1_20_3, Protocol1_20_2To1_20_3> {
@ -99,10 +99,10 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter<Clientbound
filter().handler((event, meta) -> {
final MetaType type = meta.metaType();
if (type == Types1_20_3.META_TYPES.componentType) {
meta.setTypeAndValue(Types1_20_2.META_TYPES.componentType, Protocol1_20_3To1_20_2.tagComponentToJson(meta.value()));
meta.setTypeAndValue(Types1_20_2.META_TYPES.componentType, ComponentConverter.tagComponentToJson(meta.value()));
return;
} else if (type == Types1_20_3.META_TYPES.optionalComponentType) {
meta.setTypeAndValue(Types1_20_2.META_TYPES.optionalComponentType, Protocol1_20_3To1_20_2.tagComponentToJson(meta.value()));
meta.setTypeAndValue(Types1_20_2.META_TYPES.optionalComponentType, ComponentConverter.tagComponentToJson(meta.value()));
return;
} else if (type == Types1_20_3.META_TYPES.particleType) {
final Particle particle = (Particle) meta.getValue();

Datei anzeigen

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