mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 00:55:45 +00:00
added Lands and Residence support
This commit is contained in:
parent
e6e32c7621
commit
4e62c743cb
BIN
LocalJars/Residence4.9.1.9.jar
Normal file
BIN
LocalJars/Residence4.9.1.9.jar
Normal file
Binary file not shown.
22
pom.xml
22
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<version>2.14.2</version>
|
||||
<version>2.14.3</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
@ -86,11 +86,6 @@
|
||||
<id>factions-uuid</id>
|
||||
<url>http://ci.ender.zone/plugin/repository/everything/</url>
|
||||
</repository>
|
||||
<!--repository>
|
||||
<id>residence</id>
|
||||
<url>https://github.com/Zrips/Residence/tree/master/src</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
</repository-->
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<!--Spigot API-->
|
||||
@ -168,5 +163,20 @@
|
||||
<version>1.6.9.5-U0.5.16</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Lands (https://www.spigotmc.org/resources/lands.53313/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.angeschossen</groupId>
|
||||
<artifactId>LandsAPI</artifactId>
|
||||
<version>4.9.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Residence v4.9.1.9 (https://www.spigotmc.org/resources/residence.11480/) (LOCAL REPO) -->
|
||||
<dependency>
|
||||
<groupId>com.zrips</groupId>
|
||||
<artifactId>residence</artifactId>
|
||||
<version>4.9.1.9</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/LocalJars/Residence4.9.1.9.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,6 +1,7 @@
|
||||
package me.SuperRonanCraft.BetterRTP.player.rtp;
|
||||
|
||||
import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect;
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Faction;
|
||||
@ -11,22 +12,31 @@ import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.regions.RegionContainer;
|
||||
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||
import me.SuperRonanCraft.BetterRTP.Main;
|
||||
import me.angeschossen.lands.api.integration.LandsIntegration;
|
||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class RTPPluginValidation { //Safe locations depending on enabled dependencies
|
||||
|
||||
boolean checkLocation(Location loc) {
|
||||
boolean worldguard = getWorlguard(loc);
|
||||
boolean griefPrevention = getGriefprevention(loc);
|
||||
boolean towny = getTowny(loc);
|
||||
boolean redProtect = getRedProtect(loc);
|
||||
boolean factionsUUID = getFactionsUUID(loc);
|
||||
return worldguard && griefPrevention && towny && redProtect && factionsUUID;
|
||||
boolean plugin_worldguard = getWorlguard(loc);
|
||||
boolean plugin_griefPrevention = getGriefprevention(loc);
|
||||
boolean plugin_towny = getTowny(loc);
|
||||
boolean plugin_redProtect = getRedProtect(loc);
|
||||
boolean plugin_factionsUUID = getFactionsUUID(loc);
|
||||
boolean plugin_lands = getLands(loc);
|
||||
boolean plugin_residence = getResidence(loc);
|
||||
return plugin_worldguard
|
||||
&& plugin_griefPrevention
|
||||
&& plugin_towny
|
||||
&& plugin_redProtect
|
||||
&& plugin_factionsUUID
|
||||
&& plugin_lands
|
||||
&& plugin_residence;
|
||||
}
|
||||
|
||||
// TESTED on v2.12.3
|
||||
// Worldguard v7.0.4 B1, WorldEdit v7.2.0 B5
|
||||
// TESTED (v2.12.3)
|
||||
// Worldguard (v7.0.4 B1), WorldEdit (v7.2.0 B5)
|
||||
// https://dev.bukkit.org/projects/worldguard
|
||||
private boolean getWorlguard(Location loc) {
|
||||
boolean result = true;
|
||||
@ -42,8 +52,8 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
||||
return result;
|
||||
}
|
||||
|
||||
// TESTED on v2.13.0
|
||||
// GriefPrevention v16.15.0
|
||||
// TESTED (v2.13.0)
|
||||
// GriefPrevention (v16.15.0)
|
||||
// https://www.spigotmc.org/resources/griefprevention.1884/
|
||||
private boolean getGriefprevention(Location loc) {
|
||||
boolean result = true;
|
||||
@ -56,8 +66,8 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
||||
return result;
|
||||
}
|
||||
|
||||
// NOT TESTED
|
||||
// Towny v0.96.1.11
|
||||
// NOT TESTED (2.13.0)
|
||||
// Towny (v0.96.1.11)
|
||||
// https://www.spigotmc.org/resources/towny.72694/
|
||||
private boolean getTowny(Location loc) {
|
||||
boolean result = true;
|
||||
@ -70,8 +80,8 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
||||
return result;
|
||||
}
|
||||
|
||||
// TESTED 2.13.0
|
||||
// RedProtect v7.7.2
|
||||
// TESTED (2.13.0)
|
||||
// RedProtect (v7.7.2)
|
||||
// https://www.spigotmc.org/resources/redprotect.15841/
|
||||
private boolean getRedProtect(Location loc) {
|
||||
boolean result = true;
|
||||
@ -84,8 +94,8 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
||||
return result;
|
||||
}
|
||||
|
||||
// NOT TESTED 2.13.2
|
||||
// FactionsUUID v1.6.9.5-U0.5.16
|
||||
// NOT TESTED (2.13.2)
|
||||
// FactionsUUID (v1.6.9.5-U0.5.16)
|
||||
// https://www.spigotmc.org/resources/factionsuuid.1035/
|
||||
private boolean getFactionsUUID(Location loc) {
|
||||
boolean result = true;
|
||||
@ -99,19 +109,33 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende
|
||||
return result;
|
||||
}
|
||||
|
||||
// NOT TESTED 2.14.2
|
||||
// Residence v2.5.8
|
||||
// https://www.spigotmc.org/resources/residence.11480/
|
||||
/*private boolean getResidence(Location loc) {
|
||||
// NOT TESTED (2.14.3)
|
||||
// Lands (v4.9.4)
|
||||
// https://www.spigotmc.org/resources/lands.53313/
|
||||
private boolean getLands(Location loc) {
|
||||
boolean result = true;
|
||||
if (getPl().getSettings().getsDepends().isFactionsUUID())
|
||||
if (getPl().getSettings().getsDepends().isLands())
|
||||
try {
|
||||
ResidenceApi resAPI = Residence.getAPI();
|
||||
result = new LandsIntegration(Main.getInstance()).isClaimed(loc);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}*/
|
||||
}
|
||||
|
||||
// NOT TESTED (2.14.3)
|
||||
// Residence (v4.9.1.9)
|
||||
// https://www.spigotmc.org/resources/residence.11480/
|
||||
private boolean getResidence(Location loc) {
|
||||
boolean result = true;
|
||||
if (getPl().getSettings().getsDepends().isResidence())
|
||||
try {
|
||||
result = Residence.getInstance().getResidenceManager().getByLoc(loc) == null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Main getPl() {
|
||||
return Main.getInstance();
|
||||
|
@ -13,12 +13,16 @@ public class SoftDepends {
|
||||
private boolean respect_towny = false;
|
||||
private boolean respect_redProtect = false;
|
||||
private boolean respect_factionsUUID = false;
|
||||
private boolean respect_lands = false;
|
||||
private boolean respect_residence = false;
|
||||
//RETURNABLES
|
||||
private boolean worldguard = false;
|
||||
private boolean griefprevention = false;
|
||||
private boolean towny = false;
|
||||
private boolean redProtect = false;
|
||||
private boolean factionsUUID = false;
|
||||
private boolean lands = false;
|
||||
private boolean residence = false;
|
||||
|
||||
public boolean isWorldguard() {
|
||||
return worldguard;
|
||||
@ -40,6 +44,14 @@ public class SoftDepends {
|
||||
return factionsUUID;
|
||||
}
|
||||
|
||||
public boolean isLands() {
|
||||
return lands;
|
||||
}
|
||||
|
||||
public boolean isResidence() {
|
||||
return residence;
|
||||
}
|
||||
|
||||
void load() {
|
||||
FileBasics.FILETYPE config = Main.getInstance().getFiles().getType(FileBasics.FILETYPE.CONFIG);
|
||||
String pre = "Settings.Respect.";
|
||||
@ -48,11 +60,15 @@ public class SoftDepends {
|
||||
respect_towny = config.getBoolean( pre + "Towny");
|
||||
respect_redProtect = config.getBoolean( pre + "RedProtect");
|
||||
respect_factionsUUID = config.getBoolean( pre + "FactionsUUID");
|
||||
respect_lands = config.getBoolean( pre + "Lands");
|
||||
respect_residence = config.getBoolean( pre + "Residence");
|
||||
registerWorldguard();
|
||||
registerGriefPrevention();
|
||||
registerTowny();
|
||||
registerRedProtect();
|
||||
registerFactionsUUID();
|
||||
registerLands();
|
||||
registerResidence();
|
||||
}
|
||||
|
||||
public void registerWorldguard() {
|
||||
@ -85,6 +101,18 @@ public class SoftDepends {
|
||||
debug("Respecting `FactionsUUID` was " + (factionsUUID ? "SUCCESSFULLY" : "NOT") + " registered");
|
||||
}
|
||||
|
||||
public void registerLands() {
|
||||
lands = respect_lands && Bukkit.getPluginManager().isPluginEnabled("Lands");
|
||||
if (respect_lands)
|
||||
debug("Respecting `Lands` was " + (lands ? "SUCCESSFULLY" : "NOT") + " registered");
|
||||
}
|
||||
|
||||
public void registerResidence() {
|
||||
residence = respect_residence && Bukkit.getPluginManager().isPluginEnabled("Residence");
|
||||
if (respect_residence)
|
||||
debug("Respecting `Residence` was " + (residence ? "SUCCESSFULLY" : "NOT") + " registered");
|
||||
}
|
||||
|
||||
private void debug(String str) {
|
||||
if (Main.getInstance().getSettings().debug)
|
||||
Main.getInstance().getLogger().log(Level.INFO, str);
|
||||
|
@ -15,6 +15,8 @@ Settings:
|
||||
RedProtect: false
|
||||
## Respect FactionsUUID areas (https://www.spigotmc.org/resources/factionsuuid.1035/)
|
||||
FactionsUUID: false
|
||||
## Respect Lands areas (https://www.spigotmc.org/resources/lands.53313/)
|
||||
Lands: false
|
||||
## Output to console some debugging info
|
||||
Debugger: false
|
||||
## Amount of chunks to preload around a safe location
|
||||
|
@ -1,8 +1,8 @@
|
||||
main: me.SuperRonanCraft.BetterRTP.Main
|
||||
version: '2.14.2'
|
||||
version: '2.14.3'
|
||||
name: BetterRTP
|
||||
author: SuperRonanCraft
|
||||
softdepend: [Vault, WorldGuard, GriefPrevention, Towny, Factions, RedProtect]
|
||||
softdepend: [Vault, WorldGuard, GriefPrevention, Towny, Factions, RedProtect, Lands, Residence]
|
||||
api-version: '1.13'
|
||||
|
||||
commands:
|
||||
|
Loading…
x
Reference in New Issue
Block a user