From 1b2710f82347a932495a717081804338d7a43494 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 27 Nov 2019 23:50:32 +0100 Subject: [PATCH] Remove ASkyBlock ASkyBlock does only exist up to 1.12 and won't be continued to higher versions. --- worldedit-bukkit/build.gradle.kts | 1 - .../com/boydti/fawe/bukkit/FaweBukkit.java | 10 ---- .../fawe/bukkit/regions/ASkyBlockHook.java | 47 ------------------- 3 files changed, 58 deletions(-) delete mode 100644 worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/ASkyBlockHook.java diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 88b4bdb3e..74dd90fa1 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -65,7 +65,6 @@ dependencies { "implementation"("com.palmergames.bukkit:towny:0.84.0.9") { isTransitive = false } "implementation"("com.thevoxelbox.voxelsniper:voxelsniper:5.171.0") { isTransitive = false } "implementation"("com.comphenix.protocol:ProtocolLib-API:4.4.0-SNAPSHOT") { isTransitive = false } - "implementation"("com.wasteofplastic:askyblock:3.0.8.2") { isTransitive = false } } tasks.named("processResources") { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 1bc5ed32d..721a6aeab 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -12,7 +12,6 @@ import com.boydti.fawe.bukkit.listener.CFIPacketListener; import com.boydti.fawe.bukkit.listener.ChunkListener_8; import com.boydti.fawe.bukkit.listener.ChunkListener_9; import com.boydti.fawe.bukkit.listener.RenderListener; -import com.boydti.fawe.bukkit.regions.ASkyBlockHook; import com.boydti.fawe.bukkit.regions.FactionsFeature; import com.boydti.fawe.bukkit.regions.FactionsUUIDFeature; import com.boydti.fawe.bukkit.regions.FreeBuildRegion; @@ -296,15 +295,6 @@ public class FaweBukkit implements IFawe, Listener { } } - final Plugin aSkyBlock = Bukkit.getServer().getPluginManager().getPlugin("ASkyBlock"); - if (aSkyBlock != null && aSkyBlock.isEnabled()) { - try { - managers.add(new ASkyBlockHook(aSkyBlock)); - log.debug("Attempting to use plugin 'ASkyBlock' found. Using it now."); - } catch (Throwable e) { - e.printStackTrace(); - } - } if (Settings.IMP.EXPERIMENTAL.FREEBUILD) { try { managers.add(new FreeBuildRegion()); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/ASkyBlockHook.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/ASkyBlockHook.java deleted file mode 100644 index 84d328400..000000000 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/ASkyBlockHook.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.boydti.fawe.bukkit.regions; - -import com.boydti.fawe.regions.FaweMask; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.MutableBlockVector3; -import com.wasteofplastic.askyblock.ASkyBlockAPI; -import com.wasteofplastic.askyblock.Island; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.Plugin; - -public class ASkyBlockHook extends BukkitMaskManager implements Listener { - - public ASkyBlockHook(final Plugin aSkyBlock) { - super(aSkyBlock.getName()); - - } - - public boolean isAllowed(Player player, Island island, MaskType type) { - return island != null && (player.getUniqueId().equals(island.getOwner()) || (type == MaskType.MEMBER && island.getMembers().contains(player.getUniqueId()) && hasMemberPermission(player))); - } - - @Override - public FaweMask getMask(final com.sk89q.worldedit.entity.Player player, MaskType type) { - final Location location = BukkitAdapter.adapt(player).getLocation(); - - Island island = ASkyBlockAPI.getInstance().getIslandAt(location); - if (island != null && isAllowed(BukkitAdapter.adapt(player), island, type)) { - - Location center1 = island.getCenter(); - MutableBlockVector3 center = MutableBlockVector3.at(center1.getX(), center1.getY(), center1.getZ()); - BlockVector3 pos1 = BlockVector3.at(island.getMinProtectedX(), 0, island.getMinProtectedZ()); - MutableBlockVector3 pos2 = center.add(center.subtract(pos1)).mutY(255); - - return new FaweMask(pos1, pos2) { - @Override - public boolean isValid(com.sk89q.worldedit.entity.Player player, MaskType type) { - return isAllowed(BukkitAdapter.adapt(player), island, type); - } - }; - } - - return null; - } -}