mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 00:55:45 +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>
|
||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<!-- MinePlots Repo -->
|
||||
<repository>
|
||||
<id>minecodes-repository-releases</id>
|
||||
<name>mineCodes Organization Repository</name>
|
||||
<url>https://repository.minecodes.pl/releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<!--Spigot API-->
|
||||
@ -362,5 +368,12 @@
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</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>
|
||||
</project>
|
||||
|
@ -18,6 +18,8 @@ public enum REGIONPLUGINS {
|
||||
TOWNY("Towny", new RTP_Towny()),
|
||||
ULTIMATECLAIMS("UltimateClaims", new RTP_UltimateClaims()),
|
||||
WORLDGUARD("WorldGuard", new RTP_WorldGuard()),
|
||||
MINEPLOTS("MinePlots", new RTP_MinePlots()),
|
||||
|
||||
;
|
||||
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
||||
@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:
|
||||
Respect:
|
||||
## Respect MinePlots plots (https://builtbybit.com/resources/mineplots.21646/)
|
||||
MinePlots: false
|
||||
## Respect WorldGuard areas (https://dev.bukkit.org/projects/worldguard)
|
||||
WorldGuard: false
|
||||
## Respect GriefPrevention areas (https://www.spigotmc.org/resources/griefprevention.1884/)
|
||||
|
Loading…
x
Reference in New Issue
Block a user