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:
Ursprung
f8d10be031
Commit
43ebe3c3e3
@ -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()));
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren