Allow AreaEffectCloud#setColor to reset color for null (#12760)
This commit is contained in:
parent
a6e0c08fdf
commit
e792779dd8
2 changed files with 3 additions and 3 deletions
|
@ -241,9 +241,9 @@ public interface AreaEffectCloud extends Entity {
|
|||
/**
|
||||
* Sets the color of this cloud. Will be applied as a tint to its particles.
|
||||
*
|
||||
* @param color cloud color
|
||||
* @param color cloud color or {@code null} to reset to default
|
||||
*/
|
||||
void setColor(@NotNull Color color);
|
||||
void setColor(@Nullable Color color);
|
||||
|
||||
/**
|
||||
* Retrieve the original source of this cloud.
|
||||
|
|
|
@ -128,7 +128,7 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
|||
@Override
|
||||
public void setColor(Color color) {
|
||||
PotionContents old = this.getHandle().potionContents;
|
||||
this.getHandle().setPotionContents(new PotionContents(old.potion(), Optional.of(color.asRGB()), old.customEffects(), old.customName()));
|
||||
this.getHandle().setPotionContents(new PotionContents(old.potion(), Optional.ofNullable(color).map(Color::asRGB), old.customEffects(), old.customName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue