Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Add alpha to particle colors in 1.20.3->.5 (#3827)
Dieser Commit ist enthalten in:
Ursprung
71313b4753
Commit
a8d7ab62e3
@ -386,6 +386,10 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
}
|
||||
}
|
||||
|
||||
private int withAlpha(final int rgb) {
|
||||
return 255 << 24 | rgb & 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRewrites() {
|
||||
filter().mapMetaType(typeId -> {
|
||||
@ -423,7 +427,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
filter().type(EntityTypes1_20_5.LIVINGENTITY).index(10).handler((event, meta) -> {
|
||||
final int effectColor = meta.value();
|
||||
final Particle particle = new Particle(protocol.getMappingData().getParticleMappings().mappedId("entity_effect"));
|
||||
particle.add(Type.INT, effectColor);
|
||||
particle.add(Type.INT, withAlpha(effectColor));
|
||||
meta.setTypeAndValue(Types1_20_5.META_TYPES.particlesType, new Particle[]{particle});
|
||||
});
|
||||
|
||||
@ -466,7 +470,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
|
||||
final Particle particle = particleMeta.value();
|
||||
if (particle.id() == protocol.getMappingData().getParticleMappings().mappedId("entity_effect")) {
|
||||
particle.getArgument(0).setValue(color);
|
||||
particle.getArgument(0).setValue(withAlpha(color));
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren