Skip to content

Commit

Permalink
Update effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulu13022002 committed Feb 24, 2025
1 parent e5a8ee8 commit 9fa4dfd
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 187 deletions.
21 changes: 10 additions & 11 deletions paper-api/src/main/java/org/bukkit/Color.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static Color fromRGB(int red, int green, int blue) throws IllegalArgument
* @param blue integer from 0-255
* @param green integer from 0-255
* @param red integer from 0-255
* @return a new Color object for the red, green, blue
* @return a new Color object for the blue, green, red
* @throws IllegalArgumentException if any value is strictly {@literal >255 or <0}
*/
@NotNull
Expand Down Expand Up @@ -201,10 +201,10 @@ private Color(int red, int green, int blue) {
}

private Color(int alpha, int red, int green, int blue) {
Preconditions.checkArgument(alpha >= 0 && alpha <= BIT_MASK, "Alpha[%s] is not between 0-255", alpha);
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);
Preconditions.checkArgument(red >= 0 && red <= 0xff, "Red[%s] is not between 0-255", red);
Preconditions.checkArgument(green >= 0 && green <= 0xff, "Green[%s] is not between 0-255", green);
Preconditions.checkArgument(blue >= 0 && blue <= 0xff, "Blue[%s] is not between 0-255", blue);

this.alpha = (byte) alpha;
this.red = (byte) red;
Expand All @@ -225,7 +225,7 @@ public int getAlpha() {
* Creates a new Color object with specified component
*
* @param alpha the alpha component, from 0 to 255
* @return a new color object with the red component
* @return a new color object with the alpha component
*/
@NotNull
public Color setAlpha(int alpha) {
Expand Down Expand Up @@ -264,8 +264,8 @@ public int getGreen() {
/**
* Creates a new Color object with specified component
*
* @param green the red component, from 0 to 255
* @return a new color object with the red component
* @param green the green component, from 0 to 255
* @return a new color object with the green component
*/
@NotNull
public Color setGreen(int green) {
Expand All @@ -284,8 +284,8 @@ public int getBlue() {
/**
* Creates a new Color object with specified component
*
* @param blue the red component, from 0 to 255
* @return a new color object with the red component
* @param blue the blue component, from 0 to 255
* @return a new color object with the blue component
*/
@NotNull
public Color setBlue(int blue) {
Expand Down Expand Up @@ -401,7 +401,6 @@ public Map<String, Object> serialize() {
);
}

@SuppressWarnings("javadoc")
@NotNull
public static Color deserialize(@NotNull Map<String, Object> map) {
return fromARGB(
Expand Down
Loading

0 comments on commit 9fa4dfd

Please sign in to comment.