Skip to content

Update effect#12169

Open
Lulu13022002 wants to merge 1 commit into
PaperMC:mainfrom
Lulu13022002:up/effect
Open

Update effect#12169
Lulu13022002 wants to merge 1 commit into
PaperMC:mainfrom
Lulu13022002:up/effect

Conversation

@Lulu13022002
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread paper-api/src/main/java/org/bukkit/Color.java
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
Copy Markdown
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