mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-11-21 11:46:46 +01:00
Added support for Lands
This commit is contained in:
parent
4e14b4f1e2
commit
7d14d1d7e2
13
Hook_Lands/build.gradle
Normal file
13
Hook_Lands/build.gradle
Normal file
@ -0,0 +1,13 @@
|
||||
group 'Hook_Lands'
|
||||
|
||||
dependencies {
|
||||
compileOnly 'me.angeschossen:Lands:latest'
|
||||
compileOnly "org.spigotmc:v1_8_R3-Taco:latest"
|
||||
compileOnly project(":API")
|
||||
compileOnly parent
|
||||
}
|
||||
|
||||
if (project.hasProperty('hook.compile_lands') &&
|
||||
!Boolean.valueOf(project.findProperty("hook.compile_lands").toString())) {
|
||||
project.tasks.all { task -> task.enabled = false }
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.bgsoftware.wildloaders.hooks;
|
||||
|
||||
import com.bgsoftware.wildloaders.WildLoadersPlugin;
|
||||
import com.bgsoftware.wildloaders.api.hooks.ClaimsProvider;
|
||||
import me.angeschossen.lands.api.integration.LandsIntegration;
|
||||
import me.angeschossen.lands.api.land.Land;
|
||||
import me.angeschossen.lands.api.role.enums.RoleSetting;
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public final class ClaimsProvider_Lands implements ClaimsProvider {
|
||||
|
||||
private final LandsIntegration landsIntegration;
|
||||
|
||||
public ClaimsProvider_Lands(WildLoadersPlugin plugin) {
|
||||
landsIntegration = new LandsIntegration(plugin, false);
|
||||
landsIntegration.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasClaimAccess(UUID player, Chunk chunk) {
|
||||
Land land = landsIntegration.getLand(chunk.getWorld(), chunk.getX(), chunk.getZ());
|
||||
return land == null || land.canSetting(player, RoleSetting.BLOCK_PLACE);
|
||||
}
|
||||
|
||||
}
|
@ -14,4 +14,5 @@ include 'v1_17_R1'
|
||||
include 'v1_18_R1'
|
||||
include 'Hook_EpicSpawners7'
|
||||
include 'v1_18_R2'
|
||||
include 'Hook_Lands'
|
||||
|
||||
|
@ -50,6 +50,10 @@ public final class ProvidersHandler implements ProvidersManager {
|
||||
Optional<ClaimsProvider> claimsProvider = createInstance("ClaimsProvider_SuperiorSkyblock");
|
||||
claimsProvider.ifPresent(this::addClaimsProvider);
|
||||
}
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("Lands")) {
|
||||
Optional<ClaimsProvider> claimsProvider = createInstance("ClaimsProvider_Lands");
|
||||
claimsProvider.ifPresent(this::addClaimsProvider);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadTickableProviders() {
|
||||
|
Loading…
Reference in New Issue
Block a user