This commit is contained in:
Nassim Jahnke 2024-09-05 09:34:37 +02:00
parent be28d0c3e8
commit d0eeae92d3
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 7 additions and 11 deletions

View File

@ -63,15 +63,12 @@ public final class ComponentRewriter1_21_2 extends TranslatableRewriter<Clientbo
TagUtil.removeNamespaced(componentsTag, "equippable");
TagUtil.removeNamespaced(componentsTag, "glider");
TagUtil.removeNamespaced(componentsTag, "tooltip_style");
TagUtil.removeNamespaced(componentsTag, "death_protection");
TagUtil.removeNamespaced(componentsTag, "damage_resistant");
}
@Override
protected SerializerVersion inputSerializerVersion() {
return SerializerVersion.V1_20_5;
}
@Override
protected SerializerVersion outputSerializerVersion() {
return SerializerVersion.V1_20_5;
}
}

View File

@ -17,6 +17,7 @@
*/
package com.viaversion.viabackwards.protocol.v1_21_2to1_21.rewriter;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viabackwards.api.rewriters.EntityRewriter;
import com.viaversion.viabackwards.protocol.v1_21_2to1_21.Protocol1_21_2To1_21;
import com.viaversion.viaversion.api.minecraft.RegistryEntry;
@ -111,11 +112,8 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter<Clientbound
double movementY = wrapper.read(Types.DOUBLE);
double movementZ = wrapper.read(Types.DOUBLE);
// Unpack y and x rot
final byte yaw = wrapper.read(Types.BYTE);
final byte pitch = wrapper.read(Types.BYTE);
wrapper.write(Types.FLOAT, yaw * 360F / 256F);
wrapper.write(Types.FLOAT, pitch * 360F / 256F);
wrapper.passthrough(Types.FLOAT); // Y rot
wrapper.passthrough(Types.FLOAT); // X rot
// Just keep the new values in there
final int relativeArguments = wrapper.read(Types.INT);
@ -234,7 +232,8 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter<Clientbound
wrapper.passthrough(Types.VAR_INT); // Latency
}
if (actions.get(5)) {
wrapper.passthrough(Types.TAG); // Display name
final Tag displayName = wrapper.passthrough(Types.TAG);
protocol.getComponentRewriter().processTag(wrapper.user(), displayName);
}
// New one