Skip to content

Commit e792779

Browse files
authored
Allow AreaEffectCloud#setColor to reset color for null (#12760)
1 parent a6e0c08 commit e792779

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

paper-api/src/main/java/org/bukkit/entity/AreaEffectCloud.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ public interface AreaEffectCloud extends Entity {
241241
/**
242242
* Sets the color of this cloud. Will be applied as a tint to its particles.
243243
*
244-
* @param color cloud color
244+
* @param color cloud color or {@code null} to reset to default
245245
*/
246-
void setColor(@NotNull Color color);
246+
void setColor(@Nullable Color color);
247247

248248
/**
249249
* Retrieve the original source of this cloud.

paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public Color getColor() {
128128
@Override
129129
public void setColor(Color color) {
130130
PotionContents old = this.getHandle().potionContents;
131-
this.getHandle().setPotionContents(new PotionContents(old.potion(), Optional.of(color.asRGB()), old.customEffects(), old.customName()));
131+
this.getHandle().setPotionContents(new PotionContents(old.potion(), Optional.ofNullable(color).map(Color::asRGB), old.customEffects(), old.customName()));
132132
}
133133

134134
@Override

0 commit comments

Comments
 (0)