mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-22 10:15:43 +01:00
FabledSkyBlock compatibility (beta)
This commit is contained in:
parent
6cf11be83f
commit
6684beff9e
@ -16,6 +16,7 @@ import com.songoda.core.nms.nbt.NBTItem;
|
|||||||
import com.songoda.epichoppers.boost.BoostData;
|
import com.songoda.epichoppers.boost.BoostData;
|
||||||
import com.songoda.epichoppers.boost.BoostManager;
|
import com.songoda.epichoppers.boost.BoostManager;
|
||||||
import com.songoda.epichoppers.commands.*;
|
import com.songoda.epichoppers.commands.*;
|
||||||
|
import com.songoda.epichoppers.compatiility.EpicHoppersPermission;
|
||||||
import com.songoda.epichoppers.database.DataManager;
|
import com.songoda.epichoppers.database.DataManager;
|
||||||
import com.songoda.epichoppers.database.migrations._1_InitialMigration;
|
import com.songoda.epichoppers.database.migrations._1_InitialMigration;
|
||||||
import com.songoda.epichoppers.handlers.TeleportHandler;
|
import com.songoda.epichoppers.handlers.TeleportHandler;
|
||||||
@ -32,6 +33,7 @@ import com.songoda.epichoppers.storage.types.StorageYaml;
|
|||||||
import com.songoda.epichoppers.tasks.HopTask;
|
import com.songoda.epichoppers.tasks.HopTask;
|
||||||
import com.songoda.epichoppers.utils.Methods;
|
import com.songoda.epichoppers.utils.Methods;
|
||||||
import com.songoda.epichoppers.utils.TeleportTrigger;
|
import com.songoda.epichoppers.utils.TeleportTrigger;
|
||||||
|
import com.songoda.skyblock.SkyBlock;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -226,6 +228,10 @@ public class EpicHoppers extends SongodaPlugin {
|
|||||||
pluginManager.registerEvents(new InteractListeners(this), this);
|
pluginManager.registerEvents(new InteractListeners(this), this);
|
||||||
pluginManager.registerEvents(new InventoryListeners(), this);
|
pluginManager.registerEvents(new InventoryListeners(), this);
|
||||||
|
|
||||||
|
if (pluginManager.isPluginEnabled("FabledSkyBlock")) {
|
||||||
|
SkyBlock.getInstance().getPermissionManager().registerPermission(new EpicHoppersPermission());
|
||||||
|
}
|
||||||
|
|
||||||
// Check for liquid tanks
|
// Check for liquid tanks
|
||||||
if (pluginManager.isPluginEnabled("LiquidTanks")) liquidtanks = true;
|
if (pluginManager.isPluginEnabled("LiquidTanks")) liquidtanks = true;
|
||||||
|
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.songoda.epichoppers.compatiility;
|
||||||
|
|
||||||
|
import com.songoda.skyblock.core.compatibility.CompatibleMaterial;
|
||||||
|
import com.songoda.skyblock.permission.BasicPermission;
|
||||||
|
import com.songoda.skyblock.permission.PermissionType;
|
||||||
|
|
||||||
|
public class EpicHoppersPermission extends BasicPermission {
|
||||||
|
|
||||||
|
public EpicHoppersPermission() {
|
||||||
|
super("EpicHoppers", CompatibleMaterial.HOPPER, PermissionType.GENERIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -8,6 +8,8 @@ import com.songoda.epichoppers.player.SyncType;
|
|||||||
import com.songoda.epichoppers.settings.Settings;
|
import com.songoda.epichoppers.settings.Settings;
|
||||||
import com.songoda.epichoppers.utils.Methods;
|
import com.songoda.epichoppers.utils.Methods;
|
||||||
import com.songoda.epichoppers.utils.TeleportTrigger;
|
import com.songoda.epichoppers.utils.TeleportTrigger;
|
||||||
|
import com.songoda.skyblock.SkyBlock;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
@ -64,6 +66,16 @@ public class InteractListeners implements Listener {
|
|||||||
if (WorldGuardHook.isInteractAllowed(event.getClickedBlock().getLocation()))
|
if (WorldGuardHook.isInteractAllowed(event.getClickedBlock().getLocation()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) {
|
||||||
|
SkyBlock skyBlock = SkyBlock.getInstance();
|
||||||
|
|
||||||
|
if (skyBlock.getWorldManager().isIslandWorld(event.getPlayer().getWorld()))
|
||||||
|
if (!skyBlock.getPermissionManager().hasPermission(event.getPlayer(),
|
||||||
|
skyBlock.getIslandManager().getIslandAtLocation(event.getClickedBlock().getLocation()),
|
||||||
|
"EpicHoppers"))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerData playerData = instance.getPlayerDataManager().getPlayerData(player);
|
PlayerData playerData = instance.getPlayerDataManager().getPlayerData(player);
|
||||||
|
|
||||||
if (playerData.getSyncType() == null) {
|
if (playerData.getSyncType() == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user