FactionsBridge
A Plugin which Bridges the gap between multiple APIs and Plugins which use them.
Due to the nature of Factions and their individualised implementations, it can be difficult to implement Factions into a Project without having to make a multitude of methods to support them all or choosing a specific branch to exclusively support. This project is being developed to hopefully mitigate this issue and create a unified interface, which any developer can depend, use and rely upon to make the distance for them when handling different Factions APIs.
JavaDocs
To the view the JavaDocs, visit the following website: <redacted>
Plugins which are supported.
As of Version 1.3.7, 17 (two major versions of KingdomsX) different versions of Factions are supported.
- FactionsX
- FactionsUUID
- SavageFactions (Abandoned)
- SupremeFactions
- KingdomsX
- KingdomsX 1.14+
- MassiveFactions
- FactionsBlue
- Atlas Factions
- SaberFactions
- MedievalFactions
- LegacyFactions
- UltimateFactions
- Towny
- KoreFactions/Golfing8's Factions.
- Improved Factions
- VulcanFactions
Head over to the GitHub to see purchase/documentation links.
Git:
https://github.com/CallumJohnson/FactionsBridge
How to use the API
To begin, you need to remove Factions from your dependancies, this will hopefully be a full replacement and if it is not, please create an issue/contact me to get your desired functionality added into this project. Added FactionsBridge into your plugin.yml dependancies to ensure that your plugin is hooked correctly.
Code (YAML):
name
: YourProject
main
: com.yourname.yourproject.YourProject
version
: 1.0-Snapshot-of-the-century
# If you are shading the project in, include the following:
softdepend
:
[Factions, FactionsX, FactionsBlue, KingdomsX, Kingdoms, LegacyFactions, MedievalFactions, UltimateFactions, Towny, ImprovedFactions
]
# If you are depending on the standalone plugin, including the following:
softdepend/depend
:
[FactionsBridge
]
# depending on your preference or requirements.
If you are shading the project into your plugin, please make sure to 'connect' to the FactionsBridge class when you do.
If you are shading the project into your own, please make sure to utilise relocations as this will resolve the large majority of problems.
How do I connect for Shading?
Code (Java):
FactionsBridge bridge
=
new FactionsBridge
(
)
;
// This will create all methodology using the Plugin Object you provide.
bridge.
connect
(yourPluginObject
)
;
// 1.0.0->Present.
// If you do not require factions but you want console output, use these parameters.
bridge.
connect
(yourPluginObject,
true,
false
)
;
// 1.1.2->Present.
// ->> connect(plugin, consoleOutput, requiresFactions)
/*
FactionsBridge will bridge the APIs and then allow you to use the following
methods for access to the API methods.
*/
How do I get access to the API?
Code (Java):
// This is how to obtain the API.
FactionsAPI api
= FactionsBridge.
getFactionsAPI
(
)
;
/*
The API class has many methods which will hopefully add all the
functionality you could ever require.
*/
There are also events which are bridged, these events are listened to within FactionsBridge and then ported into the API so you can use them at the same time.
Code (YAML):
FactionClaimEvent
# When a Faction claims land. (1.2.0)
FactionUnclaimAllEvent
# When a Faction unclaims all their land. (1.2.0)
FactionUnclaimEvent
# When a Faction unclaims land. (1.2.0)
FactionCreateEvent
# When a Faction is created. (1.2.0)
FactionDisbandEvent
# When a Faction is disbanded. (1.2.0)
FactionRenameEvent
# When a Faction is renamed. (1.2.0)
FactionLeaveEvent
# When a Player Leaves or is Kicked from a Faction. (1.2.0)
FactionJoinEvent
# When a Player Joins a Faction. (1.2.0)
Side-note:
This API is very unstable and is a very basic implementation of the concept, updates will come to increase stability and fix issues if they arise.
The standalone plugin (FactionsBridge/BridgePlugin) uses bStats to track implementations.
See more here:
https://bstats.org/plugin/bukkit/FactionsBridge/11893
Contact Us
Discord:
http://discord.customenchantsdevelopment.ovh