3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-17 00:20:09 +01:00

Drop Residence integration

Dieser Commit ist enthalten in:
Alexander Brandes 2023-03-07 13:46:58 +01:00
Ursprung ccb503e49d
Commit 76c87517e1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 158F5701A6AAD00C
5 geänderte Dateien mit 0 neuen und 82 gelöschten Zeilen

Datei anzeigen

@ -10,7 +10,6 @@ worldguard-bukkit = "7.0.7"
mapmanager = "1.8.0-SNAPSHOT" mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "16.18" griefprevention = "16.18"
griefdefender = "2.1.0-SNAPSHOT" griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1"
towny = "0.98.4.18" towny = "0.98.4.18"
# Third party # 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" } mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" }
griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" } griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" }
griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } 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" } towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" }
# Third Party # Third Party

Datei anzeigen

@ -89,7 +89,6 @@ dependencies {
compileOnly(libs.mapmanager) { isTransitive = false } compileOnly(libs.mapmanager) { isTransitive = false }
compileOnly(libs.griefprevention) { isTransitive = false } compileOnly(libs.griefprevention) { isTransitive = false }
compileOnly(libs.griefdefender) { isTransitive = false } compileOnly(libs.griefdefender) { isTransitive = false }
compileOnly(libs.residence) { isTransitive = false }
compileOnly(libs.towny) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false }
compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false }
compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false }

Datei anzeigen

@ -7,7 +7,6 @@ import com.fastasyncworldedit.bukkit.listener.ChunkListener9;
import com.fastasyncworldedit.bukkit.listener.RenderListener; import com.fastasyncworldedit.bukkit.listener.RenderListener;
import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature; import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature;
import com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature; import com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature;
import com.fastasyncworldedit.bukkit.regions.ResidenceFeature;
import com.fastasyncworldedit.bukkit.regions.TownyFeature; import com.fastasyncworldedit.bukkit.regions.TownyFeature;
import com.fastasyncworldedit.bukkit.regions.WorldGuardFeature; import com.fastasyncworldedit.bukkit.regions.WorldGuardFeature;
import com.fastasyncworldedit.bukkit.util.BukkitTaskManager; import com.fastasyncworldedit.bukkit.util.BukkitTaskManager;
@ -222,14 +221,6 @@ public class FaweBukkit implements IFawe, Listener {
} catch (Throwable ignored) { } 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 = final Plugin griefpreventionPlugin =
Bukkit.getServer().getPluginManager().getPlugin("GriefPrevention"); Bukkit.getServer().getPluginManager().getPlugin("GriefPrevention");
if (griefpreventionPlugin != null && griefpreventionPlugin.isEnabled()) { if (griefpreventionPlugin != null && griefpreventionPlugin.isEnabled()) {

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -223,9 +223,6 @@ public class WorldEditPlugin extends JavaPlugin {
// Enable metrics // Enable metrics
Metrics m = new Metrics(this, BSTATS_ID); 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 // Check if we are in a safe environment
ServerLib.checkUnsafeForks(); ServerLib.checkUnsafeForks();
// Check if a new build is available // Check if a new build is available