Some 24w10a changes

This commit is contained in:
Nassim Jahnke 2024-03-07 11:14:34 +01:00
parent 1647b18233
commit a453163822
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
8 changed files with 21 additions and 14 deletions

View File

@ -72,7 +72,7 @@ public class BackwardsStructuredItemRewriter<C extends ClientboundPacketType, S
// Add custom model data
if (mappedItem.customModelData() != null && !data.contains(StructuredDataKey.CUSTOM_MODEL_DATA)) {
data.add(StructuredDataKey.CUSTOM_MODEL_DATA, mappedItem.customModelData());
data.set(StructuredDataKey.CUSTOM_MODEL_DATA, mappedItem.customModelData());
}
// TODO custom name
@ -118,7 +118,7 @@ public class BackwardsStructuredItemRewriter<C extends ClientboundPacketType, S
}
final CompoundTag tag = new CompoundTag();
data.add(StructuredDataKey.CUSTOM_DATA, tag);
data.set(StructuredDataKey.CUSTOM_DATA, tag);
return tag;
}

View File

@ -41,6 +41,7 @@ import com.viaversion.viaversion.api.type.types.ByteArrayType;
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets;
import com.viaversion.viaversion.protocols.base.ServerboundLoginPackets;
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.rewriter.CommandRewriter1_19_4;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2;
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.ClientboundPacket1_20_3;
@ -135,6 +136,8 @@ public final class Protocol1_20_3To1_20_5 extends BackwardsProtocol<ClientboundP
response.sendToServer(Protocol1_20_3To1_20_5.class);
});
new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_5.DECLARE_COMMANDS);
cancelClientbound(ClientboundPackets1_20_5.DEBUG_SAMPLE);
}
@ -205,10 +208,10 @@ public final class Protocol1_20_3To1_20_5 extends BackwardsProtocol<ClientboundP
@Override
protected PacketTypesProvider<ClientboundPacket1_20_5, ClientboundPacket1_20_3, ServerboundPacket1_20_5, ServerboundPacket1_20_3> createPacketTypesProvider() {
return new SimplePacketTypesProvider<>(
packetTypeMap(unmappedClientboundPacketType, ClientboundPackets1_20_5.class, ClientboundConfigurationPackets1_20_5.class),
packetTypeMap(mappedClientboundPacketType, ClientboundPackets1_20_3.class, ClientboundConfigurationPackets1_20_3.class),
packetTypeMap(mappedServerboundPacketType, ServerboundPackets1_20_5.class, ServerboundConfigurationPackets1_20_5.class),
packetTypeMap(unmappedServerboundPacketType, ServerboundPackets1_20_3.class, ServerboundConfigurationPackets1_20_2.class)
packetTypeMap(unmappedClientboundPacketType, ClientboundPackets1_20_5.class, ClientboundConfigurationPackets1_20_5.class),
packetTypeMap(mappedClientboundPacketType, ClientboundPackets1_20_3.class, ClientboundConfigurationPackets1_20_3.class),
packetTypeMap(mappedServerboundPacketType, ServerboundPackets1_20_5.class, ServerboundConfigurationPackets1_20_5.class),
packetTypeMap(unmappedServerboundPacketType, ServerboundPackets1_20_3.class, ServerboundConfigurationPackets1_20_2.class)
);
}
}

View File

@ -166,7 +166,7 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem
if (item == null) return null;
// Convert to structured item first
final Item structuredItem = vvProtocol.getItemRewriter().toStructuredItem(item);
final Item structuredItem = vvProtocol.getItemRewriter().toStructuredItem(item, false);
return super.handleItemToServer(structuredItem);
}
}

View File

@ -226,13 +226,15 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
@Override
protected void registerRewrites() {
filter().handler((event, meta) -> {
int id = meta.metaType().typeId();
if (id >= Types1_20_5.META_TYPES.armadilloState.typeId()) {
filter().mapMetaType(typeId -> {
int id = typeId;
if (typeId >= Types1_20_5.META_TYPES.armadilloState.typeId()) {
id--;
}
meta.setMetaType(Types1_20_3.META_TYPES.byId(id));
if (typeId >= Types1_20_5.META_TYPES.wolfVariantType.typeId()) {
id--;
}
return Types1_20_3.META_TYPES.byId(id);
});
registerMetaTypeHandler1_20_3(
@ -251,6 +253,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
filter().type(EntityTypes1_20_5.LLAMA).addIndex(20); // Carpet color
filter().type(EntityTypes1_20_5.ARMADILLO).removeIndex(17); // State
filter().type(EntityTypes1_20_5.WOLF).removeIndex(22); // Wolf variant
}
@Override

View File

@ -1,4 +1,4 @@
projectVersion=4.10.0-24w09a-SNAPSHOT
projectVersion=4.10.0-24w10a-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

View File

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

View File

@ -9,6 +9,7 @@ dependencyResolutionManagement {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.spongepowered.org/maven")
mavenCentral()
mavenLocal()
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
}