3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-17 13:30:14 +01:00

Fix 1.17->1.16 and 1.16.2->1.16.1 meta types

Dieser Commit ist enthalten in:
KennyTV 2021-07-07 10:15:32 +02:00
Ursprung f8d10be031
Commit 43ebe3c3e3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 11 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -248,6 +248,8 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
@Override
protected void registerRewrites() {
filter().handler((event, meta) -> {
meta.setMetaType(MetaType1_14.byId(meta.metaType().typeId()));
MetaType type = meta.metaType();
if (type == MetaType1_14.Slot) {
meta.setValue(protocol.getItemRewriter().handleItemToClient((Item) meta.getValue()));

Datei anzeigen

@ -23,10 +23,10 @@ import com.viaversion.viabackwards.protocol.protocol1_16_1to1_16_2.Protocol1_16_
import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_16_2Types;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_16;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_14;
import com.viaversion.viaversion.api.type.types.version.Types1_16;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
@ -50,7 +50,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
registerTracker(ClientboundPackets1_16_2.SPAWN_PAINTING, Entity1_16_2Types.PAINTING);
registerTracker(ClientboundPackets1_16_2.SPAWN_PLAYER, Entity1_16_2Types.PLAYER);
registerRemoveEntities(ClientboundPackets1_16_2.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_14.METADATA_LIST);
registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_16.METADATA_LIST);
protocol.registerClientbound(ClientboundPackets1_16_2.JOIN_GAME, new PacketRemapper() {
@Override
@ -104,7 +104,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
@Override
protected void registerRewrites() {
registerMetaTypeHandler(MetaType1_14.Slot, MetaType1_14.BlockID, MetaType1_14.PARTICLE, MetaType1_14.OptChat);
registerMetaTypeHandler(MetaType1_16.ITEM, MetaType1_16.BLOCK_STATE, MetaType1_16.PARTICLE, MetaType1_16.OPT_COMPONENT);
mapTypes(Entity1_16_2Types.values(), Entity1_16Types.class);
mapEntityTypeWithData(Entity1_16_2Types.PIGLIN_BRUTE, Entity1_16_2Types.PIGLIN).jsonName("Piglin Brute");

Datei anzeigen

@ -24,7 +24,7 @@ import com.viaversion.viaversion.api.minecraft.entities.Entity1_16_2Types;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_17Types;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_16;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.Particle;
@ -153,10 +153,10 @@ public final class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17
@Override
protected void registerRewrites() {
filter().handler((event, meta) -> {
meta.setMetaType(MetaType1_14.byId(meta.metaType().typeId()));
meta.setMetaType(MetaType1_16.byId(meta.metaType().typeId()));
MetaType type = meta.metaType();
if (type == MetaType1_14.PARTICLE) {
if (type == MetaType1_16.PARTICLE) {
Particle particle = (Particle) meta.getValue();
if (particle.getId() == 15) { // Dust / Dust Transition
// Remove transition target color values 4-6
@ -169,7 +169,7 @@ public final class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17
}
rewriteParticle(particle);
} else if (type == MetaType1_14.Pose) {
} else if (type == MetaType1_16.POSE) {
// Goat LONG_JUMP added at 6
int pose = meta.value();
if (pose == 6) {
@ -181,7 +181,7 @@ public final class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17
});
// Particles have already been handled
registerMetaTypeHandler(MetaType1_14.Slot, MetaType1_14.BlockID, null, MetaType1_14.OptChat);
registerMetaTypeHandler(MetaType1_16.ITEM, MetaType1_16.BLOCK_STATE, null, MetaType1_16.OPT_COMPONENT);
mapTypes(Entity1_17Types.values(), Entity1_16_2Types.class);
filter().type(Entity1_17Types.AXOLOTL).cancel(17);