-
Notifications
You must be signed in to change notification settings - Fork 13
API
The LegacyFactions API is always undergoing improvements. Hopefully this documentation will help you understand how it works!
These docs are still "under construction" but is done on a best effort basis. If you need help feel free to open an issue ticket asking for help.
Use Gradle or Maven? Read this article.
Unlike other forks, the plugin name and package has been changed. So you can detect LegacyFactions like so:
if (Bukkit.getPluginManager().isPluginEnabled("LegacyFactions")) {
// Woo! The plugin class is also net.redstoneore.legacyfactions.Factions
// There is a singleton you can grab with Factions.get()
}
Make sure you depend or softdepend on LegacyFactions.
- EventFactionsChange
- EventFactionsCreate
- EventFactionsDisband
- EventFactionsLandChange
- EventFactionsNameChange
- EventFactionsPowerLoss
- EventFactionsRelation
- EventFactionsRelationChange
- EventFactionsWarpCreate
- EventFactionsWarpDelete
When developing there are a few things you should try to do to avoid breaking LegacyFactions or interrupting other plugins.
The docs are here so we don't have to answer the same questions repeatedly.
Using the previous example, you should ensure LegacyFactions is enabled before you hook into it:
if (Bukkit.getPluginManager().isPluginEnabled("LegacyFactions")) {
this.legacyFactionsEnabled = true;
LegacyFactionsFeatures.get().enable();
}
You really shouldn't be storing or modify the results of FactionColl.all()
- if you need to fetch a Faction later use FactionColl.get(faction name/id)
Any Collections/Lists/Sets should be considered a snapshot of the current state. Meaning the moment you fetch it, they are technically outdated. You shouldn't modify them as most of the time they won't make changes to the model.
Deprecated methods will be removed from LegacyFactions at some point (and we are keen to remove them as soon as we can!) so please use new methods. The information is in the JavaDoc.
Faction names can change. Faction IDs can not! So if you need to remember a faction for later, use the faction id.
📚 Looking for documentation? You're in the right place. Start with the items on the right of the page.
🐞 Found a bug? Please open a GitHub Issue.
🆘 Need help? Jump on our discord channel - we'll do our best to help 😄
⭐️ If you like LegacyFactions please leave a review and let others know!