Skip to content

Commit

Permalink
Add FactionsBridge Support (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicallyCoded committed Jun 12, 2023
1 parent 3b34dd7 commit 1126518
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@
<id>devmart-other</id>
<url>https://nexuslite.gcnt.net/repos/other/</url>
</repository>
<repository>
<id>devmart-public</id>
<url>https://nexuslite.gcnt.net/repos/public/</url>
</repository>
</repositories>
<dependencies>
<!--Spigot API-->
Expand Down Expand Up @@ -337,6 +341,12 @@
<version>0.2.3-legacy-support</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.dansplugins.factionsystem</groupId>
<artifactId>FactionsBridge</artifactId>
<version>1.3.8</version>
<scope>provided</scope>
</dependency>
<!-- CAN BE UNCOMMENTED IF YOU HAVE ACCESS TO THE PLUGIN -->
<!-- Private Repoed -->
<!-- This is uploaded to our private repo on https://repo.ronanplugins.com -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public enum REGIONPLUGINS {
ULTIMATECLAIMS("UltimateClaims", new RTP_UltimateClaims()),
WORLDGUARD("WorldGuard", new RTP_WorldGuard()),
MINEPLOTS("MinePlots", new RTP_MinePlots()),
FACTIONSBRIDGE("FactionsBridge", new RTP_FactionsBridge());

;
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
@Getter private final String setting_name, pluginyml_name;
@Getter private final RegionPluginCheck validator;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;

import cc.javajobs.factionsbridge.FactionsBridge;
import org.bukkit.Location;

public class RTP_FactionsBridge implements RegionPluginCheck {

// NOT TESTED (3.6.9)
// FactionsBridge (v1.3.8)
// https://www.spigotmc.org/resources/factionsbridge.89716/
public boolean check(Location loc) {
boolean result = true;
if (REGIONPLUGINS.FACTIONSBRIDGE.isEnabled())
try {
boolean claimed = FactionsBridge.getFactionsAPI().getClaim(loc).isClaimed();
result = !claimed;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Settings:
SaberFactions: false
## Respect HuskTowns areas (https://www.spigotmc.org/resources/husktowns.92672/) (Added in 3.4.5)
HuskTowns: false
## Respect FactionsBridge compatible claims (https://www.spigotmc.org/resources/factionsbridge.89716/) (Added in 3.6.9)
FactionsBridge: false

## Output to console some debugging info
Debugger: false
Expand Down

0 comments on commit 1126518

Please sign in to comment.