From 4a8bd2cca2fa37afc1971d901f6a35cd5b052c2e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 7 Feb 2024 18:29:19 +0100 Subject: [PATCH] 24w06a --- .../api/minecraft/RegistryEntry.java | 7 +- .../minecraft/entities/EntityTypes1_20_5.java | 6 +- .../api/protocol/version/ProtocolVersion.java | 2 +- .../api/type/types/RegistryEntryType.java | 4 +- .../api/type/types/version/Types1_20_5.java | 4 +- .../data/entity/TrackedEntityImpl.java | 9 + .../Protocol1_20_5To1_20_3.java | 13 ++ ...ClientboundConfigurationPackets1_20_5.java | 3 +- .../packet/ClientboundPackets1_20_5.java | 186 +++++++++--------- ...ServerboundConfigurationPackets1_20_5.java | 3 +- .../packet/ServerboundPackets1_20_5.java | 76 +++---- .../BlockItemPacketRewriter1_20_5.java | 9 +- .../rewriter/EntityPacketRewriter1_20_5.java | 4 + .../viaversion/rewriter/EntityRewriter.java | 7 + .../viaversion/data/identifiers-1.20.5.nbt | Bin 3985 -> 4031 bytes .../data/mappings-1.20.3to1.20.5.nbt | Bin 871 -> 542 bytes gradle.properties | 2 +- 17 files changed, 187 insertions(+), 148 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/RegistryEntry.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/RegistryEntry.java index 611090592..018c56a8d 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/RegistryEntry.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/RegistryEntry.java @@ -23,12 +23,13 @@ package com.viaversion.viaversion.api.minecraft; import com.github.steveice10.opennbt.tag.builtin.Tag; +import org.checkerframework.checker.nullness.qual.Nullable; public final class RegistryEntry { private final String key; private final Tag tag; - public RegistryEntry(String key, Tag tag) { + public RegistryEntry(String key, @Nullable Tag tag) { this.key = key; this.tag = tag; } @@ -37,11 +38,11 @@ public final class RegistryEntry { return key; } - public Tag tag() { + public @Nullable Tag tag() { return tag; } public RegistryEntry withKey(final String key) { - return new RegistryEntry(key, tag.copy()); + return new RegistryEntry(key, tag != null ? tag.copy() : null); } } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java index 8ae03fa0a..e80556332 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_20_5.java @@ -100,7 +100,7 @@ public enum EntityTypes1_20_5 implements EntityType { DONKEY(CHESTED_HORSE), MULE(CHESTED_HORSE), LLAMA(CHESTED_HORSE), - TRADER_LLAMA(CHESTED_HORSE), + TRADER_LLAMA(LLAMA), HORSE(ABSTRACT_HORSE), SKELETON_HORSE(ABSTRACT_HORSE), ZOMBIE_HORSE(ABSTRACT_HORSE), @@ -220,7 +220,9 @@ public enum EntityTypes1_20_5 implements EntityType { EGG(PROJECTILE_ABSTRACT), POTION(PROJECTILE_ABSTRACT), EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT), - WIND_CHARGE(PROJECTILE_ABSTRACT), + ABSTRACT_WIND_CHARGE(PROJECTILE_ABSTRACT, null), + WIND_CHARGE(ABSTRACT_WIND_CHARGE), + BREEZE_WIND_CHARGE(ABSTRACT_WIND_CHARGE), // Vehicles MINECART_ABSTRACT(ENTITY, null), diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 12ea08f96..a33dd8d52 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -86,7 +86,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new VersionRange("1.20", 0, 1)); public static final ProtocolVersion v1_20_2 = register(764, "1.20.2"); public static final ProtocolVersion v1_20_3 = register(765, "1.20.3/1.20.4", new VersionRange("1.20", 3, 4)); - public static final ProtocolVersion v1_20_5 = register(766, 175, "1.20.5"); + public static final ProtocolVersion v1_20_5 = register(766, 176, "1.20.5"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/RegistryEntryType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/RegistryEntryType.java index 7d1217efc..5c6aa46bc 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/RegistryEntryType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/RegistryEntryType.java @@ -34,12 +34,12 @@ public class RegistryEntryType extends Type { @Override public RegistryEntry read(final ByteBuf buffer) throws Exception { - return new RegistryEntry(Type.STRING.read(buffer), Type.TAG.read(buffer)); + return new RegistryEntry(Type.STRING.read(buffer), Type.OPTIONAL_TAG.read(buffer)); } @Override public void write(final ByteBuf buffer, final RegistryEntry entry) throws Exception { Type.STRING.write(buffer, entry.key()); - Type.TAG.write(buffer, entry.tag()); + Type.OPTIONAL_TAG.write(buffer, entry.tag()); } } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_5.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_5.java index 801eeb0ae..8582cf478 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_5.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_5.java @@ -27,11 +27,13 @@ import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_20_5; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_20_5 { - public static final MetaTypes1_20_5 META_TYPES = new MetaTypes1_20_5(Types1_20_3.PARTICLE); + public static final ParticleType PARTICLE = new ParticleType(); // Only safe to use after protocol loading + public static final MetaTypes1_20_5 META_TYPES = new MetaTypes1_20_5(PARTICLE); public static final Type METADATA = new MetadataType(META_TYPES); public static final Type> METADATA_LIST = new MetaListType(METADATA); } diff --git a/common/src/main/java/com/viaversion/viaversion/data/entity/TrackedEntityImpl.java b/common/src/main/java/com/viaversion/viaversion/data/entity/TrackedEntityImpl.java index 6ac968701..bfae1e9d6 100644 --- a/common/src/main/java/com/viaversion/viaversion/data/entity/TrackedEntityImpl.java +++ b/common/src/main/java/com/viaversion/viaversion/data/entity/TrackedEntityImpl.java @@ -57,4 +57,13 @@ public final class TrackedEntityImpl implements TrackedEntity { public void sentMetadata(final boolean sentMetadata) { this.sentMetadata = sentMetadata; } + + @Override + public String toString() { + return "TrackedEntityImpl{" + + "entityType=" + entityType + + ", data=" + data + + ", sentMetadata=" + sentMetadata + + '}'; + } } \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java index 2948fda8f..ee6179287 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java @@ -26,6 +26,8 @@ import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.packet.provider.PacketTypesProvider; import com.viaversion.viaversion.api.protocol.packet.provider.SimplePacketTypesProvider; import com.viaversion.viaversion.api.type.Type; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; +import com.viaversion.viaversion.api.type.types.version.Types1_20_5; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets; import com.viaversion.viaversion.protocols.base.ServerboundLoginPackets; @@ -86,6 +88,7 @@ public final class Protocol1_20_5To1_20_3 extends AbstractProtocol { @@ -109,10 +110,8 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + final PacketWrapper knownPacksPacket = wrapper.create(ClientboundConfigurationPackets1_20_5.SELECT_KNOWN_PACKS); + knownPacksPacket.write(Type.VAR_INT, 0); // No known packs, everything is sent here + knownPacksPacket.send(Protocol1_20_5To1_20_3.class); + final CompoundTag registryData = wrapper.read(Type.COMPOUND_TAG); cacheDimensionData(wrapper.user(), registryData); trackBiomeSize(wrapper.user(), registryData); diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java index 32fdc279c..24e54f2f6 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java @@ -39,6 +39,7 @@ import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.protocol.Protocol; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; +import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandler; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.rewriter.RewriterBase; @@ -595,6 +596,12 @@ public abstract class EntityRewriter from, Type to) throws Exception { + final Particle particle = wrapper.read(from); + rewriteParticle(particle); + wrapper.write(to, particle); + } + private void logException(Exception e, @Nullable EntityType type, List metadataList, Metadata metadata) { if (!Via.getConfig().isSuppressMetadataErrors() || Via.getManager().isDebug()) { Logger logger = Via.getPlatform().getLogger(); diff --git a/common/src/main/resources/assets/viaversion/data/identifiers-1.20.5.nbt b/common/src/main/resources/assets/viaversion/data/identifiers-1.20.5.nbt index 9701a5d40a582849396d01cad77f53a1757e6ad8..7083eb5679c5d299b6ab2c069d9c70f00082b9b6 100644 GIT binary patch delta 102 zcmbOzzh7RMi-CcYfg?4qB(o$lwU~o}fuUidaG{V;Qc-GZRcd^BW?o8sazC!sA9#ri8(o&PqQ84004b(BbERF delta 57 zcmdllKT%$oi-CcYfg?4qB(o$lwU~o}fuVk)aN))opII1FH}|l*G4k@Hmll`Ar{-ps Nl%y7I{>gTX0|42J5~KhC diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt index b41c468f38df7fe5e787b41712aa5e466183c49b..9b9bfdadecfe7a5439d033d4d2f98e7f5b2b1094 100644 GIT binary patch literal 542 zcmZXR%}#?r6on5AP&-(ElE#I`#D%_sJ7bLL){Rdvg)vS_fxxs27skEs;nt;z?tBhk z!NfPvGp(ZuO!xvEF5jIC5)c?Hb<>)v1Q1B1)1t~|tyNaH0&=eETIbj1P6M~c0YZ}t zfv8;vV@Slt>Up;`K3SCpf2HwJicneh5IhdZClH-6wAF8T$ncBd1*J(_Ey}!WP1YOu zwU+2wj))O`!&)`gWJOH?^t;|Rvma1U+ b7I7;ees2-4heVQ1G9s>So9vKXG6sGCgs)o@ literal 871 zcmajd%Tv=(6vy$Cq$wpulmeolSfTO|P!QxH3gQD%IPfZgUn+`-;Yd7FC}s13a+McY;_SKQ zvX@KyKRl7$lp&^{vn+`OCkt)ji0vzHuXd|_veh`-YA54jx{4YmHM{Va1ywp-xXHpl z!lFTGznH5{izcgu&(oq-m}V0&iFy3S9}znrChMCEc#9((bMqHfVqQ`C%CGxCIjpH8 zKf^i(kDFnxzMwbKSavJQ&lc)~ylRld#X4{c?52CwqZ-4Rg$VQ;M$v#68sQ+0CR{=@ zF5?PXkU%Ti(2lF%2Lbrbk)0n{{%;GVgU=DgbPqBb!c#ao%iAB7^5?o?x9q;fSX>8yF zKH?KLv4w4X#ux11E56}7Tx6hYXX&)#Dpm0_`}IG&Bx**e$Dj`bCc+V3G&;uiA4<$) AivR!s diff --git a/gradle.properties b/gradle.properties index 002458332..80d6b09b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.10.0-24w05b-SNAPSHOT +projectVersion=4.10.0-24w06a-SNAPSHOT # Smile emoji mcVersions=1.20.4, 1.20.3, 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, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9