Skip to content
This repository was archived by the owner on Nov 19, 2022. It is now read-only.

Developers

jtljac edited this page Jun 15, 2020 · 8 revisions

Factions has been made fairly transparent for developers to allow them to get data from the mod and hook into events triggered by the mod

Adding factions to your project

Method one

You can download the latest release, stick that in a directory in your project (E.G. "{Project}/libs"), then in your build.gradle tell it to compile the files in that directory by adding the following into the dependencies section of the build.gradle (replace 'libs' with whatever subdirectory you put the jar in):

compile fileTree(dir: 'libs', include: ['*.jar'])

Method two

You can add the curse maven repository to your project, and fetch Factions from there Add the following to your build.gradle:

repositories {
    maven { url 'https://jitpack.io' }
}

And under dependencies add: compile 'com.github.jtljac:Factions:1.+'

Faction Events

Many of the things that happen in factions fire events, most of these events can be cancelled and modified for new results

Event Description Fields
OutFactionEvent.FactionCreateEvent Fired when a faction is being created UUID causingPlayerID, String factionName
InFactionEvent.FactionRelationEvent Fired when a relation between two factions is changed UUID causingPlayerID, UUID factionID, UUID otherFaction, RelationState newRelation
InFactionEvent.ChunkEvent.FactionClaimEvent Fired when a faction claims some land UUID causingPlayerID, UUID factionID, UUID currentOwner, ChunkLocation position
InFactionEvent.ChunkEvent.FactionUnClaimEvent Fired when a faction releases their claim on some land UUID causingPlayerID, UUID factionID, ChunkLocation position

Faction Manager

All of factions is dealt with by the faction manager, you can access this with

FactionManager.getInstance()

which gives you access to all of the factions system, details about what you can do with this are here

Clone this wiki locally