DevLeoko / AdvancedBan

AdvancedBan is a Spigot plugin to manage punishments on single servers and server networks
GNU General Public License v3.0
159 stars 130 forks source link

Added isSilent() method for Punishment class #522

Closed OopsieWoopsie closed 3 years ago

OopsieWoopsie commented 3 years ago

No breaking changes, production-ready code :smile:

Closes #416

DevLeoko commented 3 years ago

You are only saving whether the punishment is silent or not in the object attributes but are not persisting it to the database. This results in all punishments being shown as non-silent once the server is restarted.

You will not only need to persist it to the database but also create some sort of conversion process for old databases as Aurel mentioned in #416

PmzHeroV2 commented 3 years ago

what about adding it for the event if its not possible?

OopsieWoopsie commented 3 years ago

The purpose of this is knowing wheter a punishment is silent at the time it is created so you can know it from an event listener, but what you said makes sense, this is no coherent when a punishment is get from the database because isSilent will be false in that case. Adding isSilent to the event and not in the Punishment class would be the way :+1: