Allow AreaEffectCloud#setColor to reset color for null (#12760)

This commit is contained in:
David
2025-07-16 22:00:54 +02:00
committed by GitHub
parent a6e0c08fdf
commit e792779dd8
2 changed files with 3 additions and 3 deletions
@@ -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