Skip to content

Commit

Permalink
Add CrashClaim support (#148) (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicallyCoded committed Jun 14, 2023
1 parent 0203c28 commit 2b4367b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@
<version>1.3.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.WhipDevelopment</groupId>
<artifactId>CrashClaim</artifactId>
<version>-75abe3b665-1</version>
</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,7 +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());
FACTIONSBRIDGE("FactionsBridge", new RTP_FactionsBridge()),
CRASH_CLAIM("CrashClaim", new RTP_CrashClaim());

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

import com.palmergames.bukkit.towny.TownyAPI;
import net.crashcraft.crashclaim.CrashClaim;
import net.crashcraft.crashclaim.api.CrashClaimAPI;
import org.bukkit.Location;

public class RTP_CrashClaim implements RegionPluginCheck {

// NOT TESTED (3.6.9)
// CrashClaim (1.0.39)
// https://www.spigotmc.org/resources/crashclaim-claiming-plugin.94037/
public boolean check(Location loc) {
boolean result = true;
if (REGIONPLUGINS.CRASH_CLAIM.isEnabled())
try {
result = CrashClaim.getPlugin().getApi().getClaim(loc) == null; // no claim = valid
} 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 @@ -37,6 +37,8 @@ Settings:
HuskTowns: false
## Respect FactionsBridge compatible claims (https://www.spigotmc.org/resources/factionsbridge.89716/) (Added in 3.6.9)
FactionsBridge: false
## Respect CrashClaim claims (https://www.spigotmc.org/resources/crashclaim-claiming-plugin.94037/) (Added in 3.6.9)
CrashClaim: false

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

0 comments on commit 2b4367b

Please sign in to comment.