mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2025-01-06 19:09:29 +01:00
Added support for SuperiorSkyblock as a claims provider
This commit is contained in:
parent
de54bf35c0
commit
972ea6ddb2
BIN
libs/SuperiorSkyblockAPI.jar
Normal file
BIN
libs/SuperiorSkyblockAPI.jar
Normal file
Binary file not shown.
@ -5,6 +5,7 @@ import com.bgsoftware.wildloaders.api.managers.ProvidersManager;
|
|||||||
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_FactionsUUID;
|
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_FactionsUUID;
|
||||||
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_FactionsX;
|
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_FactionsX;
|
||||||
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_MassiveFactions;
|
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_MassiveFactions;
|
||||||
|
import com.bgsoftware.wildloaders.hooks.ClaimsProvider_SuperiorSkyblock;
|
||||||
import com.bgsoftware.wildloaders.utils.threads.Executor;
|
import com.bgsoftware.wildloaders.utils.threads.Executor;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
@ -28,6 +29,9 @@ public final class ProvidersHandler implements ProvidersManager {
|
|||||||
if(Bukkit.getPluginManager().isPluginEnabled("FactionsX")){
|
if(Bukkit.getPluginManager().isPluginEnabled("FactionsX")){
|
||||||
claimsProviders.add(new ClaimsProvider_FactionsX());
|
claimsProviders.add(new ClaimsProvider_FactionsX());
|
||||||
}
|
}
|
||||||
|
if(Bukkit.getPluginManager().isPluginEnabled("SuperiorSkyblock2")){
|
||||||
|
claimsProviders.add(new ClaimsProvider_SuperiorSkyblock());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.bgsoftware.wildloaders.hooks;
|
||||||
|
|
||||||
|
import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI;
|
||||||
|
import com.bgsoftware.superiorskyblock.api.island.Island;
|
||||||
|
import com.bgsoftware.superiorskyblock.api.island.IslandPrivilege;
|
||||||
|
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer;
|
||||||
|
import com.bgsoftware.wildloaders.api.hooks.ClaimsProvider;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public final class ClaimsProvider_SuperiorSkyblock implements ClaimsProvider {
|
||||||
|
|
||||||
|
private static final IslandPrivilege BUILD = IslandPrivilege.getByName("BUILD");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasClaimAccess(UUID player, Chunk chunk) {
|
||||||
|
Island island = SuperiorSkyblockAPI.getGrid().getIslandAt(chunk);
|
||||||
|
SuperiorPlayer superiorPlayer = SuperiorSkyblockAPI.getPlayer(player);
|
||||||
|
return island != null && island.hasPermission(superiorPlayer, BUILD) && island.isInsideRange(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user