mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 17:15:47 +00:00
Add support for mineplots (https://builtbybit.com/resources/mineplots.21646/) (#130)
This commit is contained in:
parent
afb45d23cb
commit
f3a1dba7f5
13
pom.xml
13
pom.xml
@ -175,6 +175,12 @@
|
|||||||
<id>placeholderapi</id>
|
<id>placeholderapi</id>
|
||||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<!-- MinePlots Repo -->
|
||||||
|
<repository>
|
||||||
|
<id>minecodes-repository-releases</id>
|
||||||
|
<name>mineCodes Organization Repository</name>
|
||||||
|
<url>https://repository.minecodes.pl/releases</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!--Spigot API-->
|
<!--Spigot API-->
|
||||||
@ -362,5 +368,12 @@
|
|||||||
<version>2.0</version>
|
<version>2.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- MinePlots (https://builtbybit.com/resources/mineplots.21646/) (Added in 3.6.6 ) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>pl.minecodes.plots</groupId>
|
||||||
|
<artifactId>plugin-api</artifactId>
|
||||||
|
<version>3.4.5</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -18,6 +18,8 @@ public enum REGIONPLUGINS {
|
|||||||
TOWNY("Towny", new RTP_Towny()),
|
TOWNY("Towny", new RTP_Towny()),
|
||||||
ULTIMATECLAIMS("UltimateClaims", new RTP_UltimateClaims()),
|
ULTIMATECLAIMS("UltimateClaims", new RTP_UltimateClaims()),
|
||||||
WORLDGUARD("WorldGuard", new RTP_WorldGuard()),
|
WORLDGUARD("WorldGuard", new RTP_WorldGuard()),
|
||||||
|
MINEPLOTS("MinePlots", new RTP_MinePlots()),
|
||||||
|
|
||||||
;
|
;
|
||||||
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
||||||
@Getter private final String setting_name, pluginyml_name;
|
@Getter private final String setting_name, pluginyml_name;
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
import pl.minecodes.plots.api.plot.PlotApi;
|
||||||
|
import pl.minecodes.plots.api.plot.PlotServiceApi;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class RTP_MinePlots implements RegionPluginCheck{
|
||||||
|
// NOT TESTED (3.6.6)
|
||||||
|
// MinePlots- (v4.0.1)
|
||||||
|
// https://builtbybit.com/resources/mineplots.21646/
|
||||||
|
|
||||||
|
private PlotServiceApi plotServiceApi;
|
||||||
|
|
||||||
|
public boolean check(Location loc) {
|
||||||
|
boolean result = true;
|
||||||
|
if (REGIONPLUGINS.MINEPLOTS.isEnabled())
|
||||||
|
try {
|
||||||
|
RegisteredServiceProvider<PlotServiceApi> serviceProvider = Bukkit.getServicesManager().getRegistration(PlotServiceApi.class);
|
||||||
|
Objects.requireNonNull(serviceProvider, "[MinePlots Respect] Service provider is null.");
|
||||||
|
plotServiceApi = serviceProvider.getProvider();
|
||||||
|
|
||||||
|
plotServiceApi = serviceProvider.getProvider();
|
||||||
|
PlotApi plot = plotServiceApi.getPlot(loc);
|
||||||
|
|
||||||
|
if (plot != null) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,8 @@ Language-File: 'en.yml'
|
|||||||
|
|
||||||
Settings:
|
Settings:
|
||||||
Respect:
|
Respect:
|
||||||
|
## Respect MinePlots plots (https://builtbybit.com/resources/mineplots.21646/)
|
||||||
|
MinePlots: false
|
||||||
## Respect WorldGuard areas (https://dev.bukkit.org/projects/worldguard)
|
## Respect WorldGuard areas (https://dev.bukkit.org/projects/worldguard)
|
||||||
WorldGuard: false
|
WorldGuard: false
|
||||||
## Respect GriefPrevention areas (https://www.spigotmc.org/resources/griefprevention.1884/)
|
## Respect GriefPrevention areas (https://www.spigotmc.org/resources/griefprevention.1884/)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user