Residence plugin support for fly

This commit is contained in:
Fabrizio La Rosa 2020-06-19 03:07:26 +02:00
parent 2fef576a48
commit 62c819e611
3 changed files with 22 additions and 1 deletions

View File

@ -190,5 +190,11 @@
<version>LATEST</version> <version>LATEST</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.Zrips</groupId>
<artifactId>Residence</artifactId>
<scope>provided</scope>
<version>4.9.0.6</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,5 +1,9 @@
package com.songoda.skyblock.island; package com.songoda.skyblock.island;
import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.api.ResidenceApi;
import com.bekvon.bukkit.residence.containers.Flags;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.CompatibleSound; import com.songoda.core.compatibility.CompatibleSound;
@ -47,6 +51,7 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -1380,6 +1385,16 @@ public class IslandManager {
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly")) if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly"))
return; return;
// Residence support
if (Bukkit.getServer().getPluginManager().getPlugin("Residence") != null) {
ClaimedResidence res = Residence.getInstance().getResidenceManagerAPI().getByLoc(player.getLocation());
if(res != null){
if(res.getPermissions().has(Flags.fly, false)){
return;
}
}
}
Island island = getIslandAtLocation(player.getLocation()); Island island = getIslandAtLocation(player.getLocation());
UpgradeManager upgradeManager = skyblock.getUpgradeManager(); UpgradeManager upgradeManager = skyblock.getUpgradeManager();

View File

@ -5,7 +5,7 @@ api-version: 1.13
description: A unique SkyBlock plugin description: A unique SkyBlock plugin
author: Songoda author: Songoda
authors: [Fabrimat] authors: [Fabrimat]
softdepend: [HolographicDisplays, Holograms, CMI, PlaceholderAPI, MVdWPlaceholderAPI, Vault, Reserve, LeaderHeads, EpicSpawners, WildStacker, UltimateStacker, WorldEdit] softdepend: [HolographicDisplays, Holograms, CMI, PlaceholderAPI, MVdWPlaceholderAPI, Vault, Reserve, LeaderHeads, EpicSpawners, WildStacker, UltimateStacker, WorldEdit, Residence]
loadbefore: [Multiverse-Core, ProtocolLib] loadbefore: [Multiverse-Core, ProtocolLib]
commands: commands:
island: island: