Skip to content

Commit

Permalink
Remove alpha channel from particle colors in 1.20.5->.3 (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed May 6, 2024
1 parent 34101ea commit 633b4b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ private int encodeColorPart(final float part) {
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) {
Expand Down Expand Up @@ -374,7 +378,7 @@ protected void registerRewrites() {
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
Expand All @@ -383,7 +387,7 @@ protected void registerRewrites() {
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)));
}
});

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 633b4b3

Please sign in to comment.