Remove alpha channel from particle colors in 1.20.5->.3 (#737)

This commit is contained in:
EnZaXD 2024-05-06 09:50:33 +02:00 committed by GitHub
parent 34101ea8b8
commit 633b4b393b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -317,6 +317,10 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
return (int) Math.floor(part * 255);
}
private int removeAlpha(final int argb) {
return argb & 0x00FFFFFF;
}
private void moveTag(final CompoundTag compoundTag, final String from, final String to) {
final Tag tag = compoundTag.remove(from);
if (tag != null) {
@ -374,7 +378,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
color = particle.<Integer>removeArgument(0).getValue();
}
}
meta.setTypeAndValue(Types1_20_3.META_TYPES.varIntType, color);
meta.setTypeAndValue(Types1_20_3.META_TYPES.varIntType, removeAlpha(color));
});
filter().type(EntityTypes1_20_5.AREA_EFFECT_CLOUD).addIndex(9); // Color
@ -383,7 +387,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
if (particle.id() == protocol.getMappingData().getParticleMappings().mappedId("entity_effect")) {
// Move color to its own metadata
final int color = particle.<Integer>removeArgument(0).getValue();
event.createExtraMeta(new Metadata(9, Types1_20_3.META_TYPES.varIntType, color));
event.createExtraMeta(new Metadata(9, Types1_20_3.META_TYPES.varIntType, removeAlpha(color)));
}
});

View File

@ -1,4 +1,4 @@
projectVersion=4.10.1
projectVersion=4.10.2-SNAPSHOT
# Smile emoji
mcVersions=1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10