3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

Add missing dust_color_transition data remapping (changed in 24w03a)

Dieser Commit ist enthalten in:
Gero 2024-04-19 11:02:01 +02:00
Ursprung 1bb85b11e9
Commit e08c263ced
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -80,7 +80,7 @@ public class ParticleType extends DynamicType<Particle> {
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Red 0-1
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Green 0-1
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Blue 0-1
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Scale 0.01-4
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Scale 0.01-4 (moved to the end as of 24w03a / 1.20.5)
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Red
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Green
particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Blue

Datei anzeigen

@ -214,6 +214,13 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
if (particle.id() == protocol.getMappingData().getParticleMappings().mappedId("entity_effect")) {
particle.add(Type.INT, data != 0 ? ThreadLocalRandom.current().nextInt() : 0); // rgb
}
if (particle.id() == protocol.getMappingData().getParticleMappings().mappedId("dust_color_transition")) {
for (int i = 0; i < 7; i++) {
particle.add(Type.FLOAT, wrapper.read(Type.FLOAT));
}
// fromColor, scale, toColor -> fromColor, toColor, scale
particle.add(Type.FLOAT, particle.<Float> removeArgument(3).getValue());
}
if (mappings.isBlockParticle(particleId)) {
final int blockStateId = wrapper.read(Type.VAR_INT);
@ -223,6 +230,8 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
particle.add(Types1_20_5.ITEM, item);
}
// TODO: We should read the particle data of every particle.
// Otherwise reading the particle type in future versions will be broken.
wrapper.write(Types1_20_5.PARTICLE, particle);
});