Add CrashClaim support (#148) (#150)

This commit is contained in:
TechnicallyCoded
2023-06-14 23:32:47 +02:00
committed by GitHub
parent 0203c28e52
commit 2b4367b058
4 changed files with 33 additions and 1 deletions

View File

@@ -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 -->

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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