diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 42315d23d..e8daa8fd3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,6 @@ worldguard-bukkit = "7.0.7" mapmanager = "1.8.0-SNAPSHOT" griefprevention = "16.18" griefdefender = "2.1.0-SNAPSHOT" -residence = "4.5._13.1" towny = "0.98.4.18" # Third party @@ -53,7 +52,6 @@ worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", versi mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" } griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" } griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } -residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" } towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" } # Third Party diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 19e42acb5..0776ecfe8 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -89,7 +89,6 @@ dependencies { compileOnly(libs.mapmanager) { isTransitive = false } compileOnly(libs.griefprevention) { isTransitive = false } compileOnly(libs.griefdefender) { isTransitive = false } - compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java index e4f66dea3..3c1d157c3 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java @@ -7,7 +7,6 @@ import com.fastasyncworldedit.bukkit.listener.ChunkListener9; import com.fastasyncworldedit.bukkit.listener.RenderListener; import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature; import com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature; -import com.fastasyncworldedit.bukkit.regions.ResidenceFeature; import com.fastasyncworldedit.bukkit.regions.TownyFeature; import com.fastasyncworldedit.bukkit.regions.WorldGuardFeature; import com.fastasyncworldedit.bukkit.util.BukkitTaskManager; @@ -222,14 +221,6 @@ public class FaweBukkit implements IFawe, Listener { } catch (Throwable ignored) { } } - final Plugin residencePlugin = Bukkit.getServer().getPluginManager().getPlugin("Residence"); - if (residencePlugin != null && residencePlugin.isEnabled()) { - try { - managers.add(new ResidenceFeature(residencePlugin, this)); - LOGGER.info("Attempting to use plugin 'Residence'"); - } catch (Throwable ignored) { - } - } final Plugin griefpreventionPlugin = Bukkit.getServer().getPluginManager().getPlugin("GriefPrevention"); if (griefpreventionPlugin != null && griefpreventionPlugin.isEnabled()) { diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java deleted file mode 100644 index d72769176..000000000 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.fastasyncworldedit.bukkit.regions; - -import com.bekvon.bukkit.residence.Residence; -import com.bekvon.bukkit.residence.protection.ClaimedResidence; -import com.bekvon.bukkit.residence.protection.CuboidArea; -import com.fastasyncworldedit.bukkit.FaweBukkit; -import com.fastasyncworldedit.core.regions.FaweMask; -import com.fastasyncworldedit.core.util.TaskManager; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.internal.util.LogManagerCompat; -import com.sk89q.worldedit.regions.CuboidRegion; -import org.apache.logging.log4j.Logger; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.Plugin; - -public class ResidenceFeature extends BukkitMaskManager implements Listener { - - private static final Logger LOGGER = LogManagerCompat.getLogger(); - - private final FaweBukkit plugin; - private final Plugin residence; - - public ResidenceFeature(final Plugin residencePlugin, final FaweBukkit p3) { - super(residencePlugin.getName()); - this.residence = residencePlugin; - this.plugin = p3; - LOGGER.info("Plugin 'Residence' found. Using it now."); - } - - public boolean isAllowed(Player player, ClaimedResidence residence, MaskType type) { - return residence != null && - (residence.getOwner().equals(player.getName()) || - residence.getOwner().equals(player.getUniqueId().toString()) || - type == MaskType.MEMBER && TaskManager.taskManager().sync(() -> residence - .getPermissions() - .playerHas(player, "build", false))); - } - - @Override - public FaweMask getMask(final com.sk89q.worldedit.entity.Player wePlayer, final MaskType type, boolean isWhitelist) { - final Player player = BukkitAdapter.adapt(wePlayer); - final Location location = player.getLocation(); - ClaimedResidence residence = Residence.getInstance().getResidenceManager().getByLoc(location); - if (residence != null) { - boolean isAllowed; - while (!(isAllowed = isAllowed(player, residence, type)) && residence != null) { - residence = residence.getSubzoneByLoc(location); - } - if (isAllowed) { - final CuboidArea area = residence.getAreaArray()[0]; - final Location pos1 = area.getLowLoc(); - final Location pos2 = area.getHighLoc(); - final ClaimedResidence finalResidence = residence; - return new FaweMask(new CuboidRegion(BukkitAdapter.asBlockVector(pos1), BukkitAdapter.asBlockVector(pos2))) { - @Override - public boolean isValid(com.sk89q.worldedit.entity.Player player, MaskType type) { - return isAllowed(BukkitAdapter.adapt(player), finalResidence, type); - } - }; - } - } - return null; - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 876517dd6..aa2f6c4ae 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -223,9 +223,6 @@ public class WorldEditPlugin extends JavaPlugin { // Enable metrics Metrics m = new Metrics(this, BSTATS_ID); - // First introduced in build 349, release 2.5.2 - m.addCustomChart(new SimplePie("residence", () - -> WEManager.weManager().getManagers().toString().contains("residence") ? "Yes" : "No")); // Check if we are in a safe environment ServerLib.checkUnsafeForks(); // Check if a new build is available