Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update effect #12169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update effect #12169

wants to merge 1 commit into from

Conversation

Lulu13022002
Copy link
Contributor

Closes #12082

And fix more issues:

  • RECORD_PLAY should take a jukebox song
  • DRAGON_BREATH/EXTINGUISH should take a boolean

This is just a bandaid, later a better api should be done to properly enforce data types

@Lulu13022002 Lulu13022002 requested a review from a team as a code owner February 23, 2025 20:28
@Lulu13022002 Lulu13022002 force-pushed the up/effect branch 2 times, most recently from 9fa4dfd to 1682bf2 Compare February 24, 2025 12:36
Preconditions.checkArgument(red >= 0 && red <= BIT_MASK, "Red[%s] is not between 0-255", red);
Preconditions.checkArgument(green >= 0 && green <= BIT_MASK, "Green[%s] is not between 0-255", green);
Preconditions.checkArgument(blue >= 0 && blue <= BIT_MASK, "Blue[%s] is not between 0-255", blue);
Preconditions.checkArgument(alpha >= 0 && alpha <= 0xff, "Alpha[%s] is not between 0-255", alpha);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this diff? Why use the Value directly instead of BIT_MASK?

Copy link
Contributor

@lynxplay lynxplay Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am semi inclined to agree here.
I guess the intention is that "comparing a value to a mask makes no sense".

The more correct precondition I guess would be (alpha & BITMASK) == alpha.

@@ -32,7 +31,8 @@ static class TestColor {
this.r = r;
this.g = g;
this.b = b;
this.name = id + ":" + Integer.toHexString(argb).toUpperCase(Locale.ROOT) + "_" + Integer.toHexString(rgb).toUpperCase(Locale.ROOT) + "_" + Integer.toHexString(bgr).toUpperCase(Locale.ROOT) + "-a" + Integer.toHexString(a).toUpperCase(Locale.ROOT) + "-r" + Integer.toHexString(r).toUpperCase(Locale.ROOT) + "-g" + Integer.toHexString(g).toUpperCase(Locale.ROOT) + "-b" + Integer.toHexString(b).toUpperCase(Locale.ROOT);
this.name = id + ":" + Integer.toHexString(argb).toUpperCase(Locale.ROOT) + "_" + Integer.toHexString(bgr).toUpperCase(Locale.ROOT) + "-a" + Integer.toHexString(a).toUpperCase(Locale.ROOT) + "-r" + Integer.toHexString(r).toUpperCase(Locale.ROOT) + "-g" + Integer.toHexString(g).toUpperCase(Locale.ROOT) + "-b" + Integer.toHexString(b).toUpperCase(Locale.ROOT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a cleanup PR, this should be id++ + ":" +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

Effect.STEP_SOUND is actually the block break effect
3 participants