Pixelmon Sidemod API - Feature tracker

[8.3.1+] - Ribbon improvements in Pokemon implemented in vcs

Ticket description:
Hello just wanted to leave some feedback on stuff that could be changed regarding the ribbons field in the Pokemon API class.
For starters the field doesn't really need to be an ArrayList it should just be an EnumSet not like it is intended to contain duplicate elements (Pokemon#addRibbon does prevent this but not when a user gets the field itself from Pokemon#getRibbons) and if for nothing else it is more efficient.
Secondly Pokemon#addRibbon could do with a new method where the user can specify if they wish the added Ribbon to be set as displayed, the existing method could simply pass in true for the new method, there are instances where you do not intend to replace the current displayed Ribbon and from our experience more often then not it would just confuse the player, obviously you can just cache the displayed ribbon prior to adding the ribbon then restore it but a lot more convenient to just have a built in method.
Finally Pokemon#getRibbons should just return an immutable collection, this would prevent unintented adding of Ribbons such as duplicate elements in the current implementation and even assigning the developer ribbons which Pokemon#addRibbon prevents.

Proposed implementation

Comments

#23913 Posted by DanielN » 14 Dec 2021 09:24

Added for 8.3.5

Ticket details

  • Ticket ID: 16672
  • Project: Pixelmon Sidemod API
  • Status: Implemented in VCS
  • Component: Forge
  • Project version: 8.x.x
  • Priority: Normal
  • Assigned to: DanielN
  • Reported by: Licious (Send PM)
  • Reporter's tickets: (List all tickets)
  • Reported on: 30 Oct 2021 06:42
  • Ticket last visited by: Isi on 14 Dec 2021 10:30
JOIN THE TEAM