[SPIGOT-3027] Setters in PotionEffect Created: 22/Jan/17 Updated: 22/Jan/17 Resolved: 22/Jan/17 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Syst3ms | Assignee: | Unassigned |
Resolution: | Done | Votes: | 0 |
Labels: | potion, potioneffect |
Description |
Little suggestion regarding PotionEffects.
There are lots of getters for this class (getType, getDuration, getAmplifier, getColor, hasParticles and isAmbient). Although (and that's quite annoying), there aren't any setters; Here's a list of useful setters (actually they're only the reverse of the getters, so they're self-explanatory) :
|
Comments |
Comment by Syst3ms [ 22/Jan/17 ] |
*the way the API works |
Comment by Syst3ms [ 22/Jan/17 ] |
I already thought about this, but I'm creating a Skript addon and the way it works doesn't allow such things. Guess I'll drop it |
Comment by md_5 [ 22/Jan/17 ] |
This is because an immutable design pattern was chosen. |
Comment by Syst3ms [ 22/Jan/17 ] |
Hm. Looked at source code, and it appears that all properties are final. Could anyone explain me why and if it is possible to make them not final ? Sorry if that was already asked, but I didn't find anything when searching. Also, sorry if I have a noobish behaviour, it's probably because I'm new to plugin development and Spigot in general. |