SpongePowered / SpongeAPI

A Minecraft plugin API
http://www.spongepowered.org/
MIT License
1.14k stars 342 forks source link

Add Ticks#infinite #2480

Closed aromaa closed 4 months ago

aromaa commented 9 months ago

Added Ticks#infinite and updated the documentation where providing it would not make sense.

aromaa commented 9 months ago

Some other alternatives that I don't quite like are that we could change the PotionEffect#duration type to Optional<Ticks> but that's quite vague. Would that imply that not specifying the duration in the builder mean that it creates a infinite one? That however could be solved with another method PotionEffect.Builder#infinite.

Adding new more concreate type like TicksOrInfinite is basically the same approach as the Optional<Ticks> one as we couldn't implement the Ticks interface or we are back at square one. Also adds more surface area for not much added clarity?