Adjust mask managers

- Add list of "exclusive" managers to config to aid users in having some sort of prioritisation.
 - Fixes #960 if PlotSquared is added to exclusive managers, otherwise, there's no particularly sane way of adding prioritisation without requiring a treemap be added to YAML config, or for us to decide upon it ourselves
This commit is contained in:
dordsor21
2021-09-18 03:19:27 +01:00
parent fbbb4ed8fa
commit bd95d5a86d
7 changed files with 52 additions and 36 deletions

View File

@ -304,10 +304,10 @@ public class FaweBukkit implements IFawe, Listener {
return;
}
if (plotSquared.getClass().getPackage().toString().contains("intellectualsites")) {
WEManager.IMP.managers.add(new com.fastasyncworldedit.bukkit.regions.plotsquaredv4.PlotSquaredFeature());
WEManager.IMP.addManager(new com.fastasyncworldedit.bukkit.regions.plotsquaredv4.PlotSquaredFeature());
LOGGER.info("Plugin 'PlotSquared' found. Using it now.");
} else if (PlotSquared.get().getVersion().version[0] == 6) {
WEManager.IMP.managers.add(new com.fastasyncworldedit.bukkit.regions.plotsquared.PlotSquaredFeature());
WEManager.IMP.addManager(new com.fastasyncworldedit.bukkit.regions.plotsquared.PlotSquaredFeature());
LOGGER.info("Plugin 'PlotSquared' found. Using it now.");
} else {
LOGGER.error("Incompatible version of PlotSquared found. Please use PlotSquared v6.");

View File

@ -124,20 +124,12 @@ public class WorldGuardFeature extends BukkitMaskManager implements Listener {
final BlockVector3 pos1;
final BlockVector3 pos2;
if (myregion.getId().equals("__global__")) {
pos1 = BlockVector3.at(Integer.MIN_VALUE, 0, Integer.MIN_VALUE);
pos2 = BlockVector3.at(Integer.MAX_VALUE, 255, Integer.MAX_VALUE);
pos1 = BlockVector3.at(Integer.MIN_VALUE, wePlayer.getWorld().getMinY(), Integer.MIN_VALUE);
pos2 = BlockVector3.at(Integer.MAX_VALUE, wePlayer.getWorld().getMaxY(), Integer.MAX_VALUE);
} else {
if (myregion instanceof ProtectedCuboidRegion) {
pos1 = BlockVector3.at(
myregion.getMinimumPoint().getBlockX(),
myregion.getMinimumPoint().getBlockY(),
myregion.getMinimumPoint().getBlockZ()
);
pos2 = BlockVector3.at(
myregion.getMaximumPoint().getBlockX(),
myregion.getMaximumPoint().getBlockY(),
myregion.getMaximumPoint().getBlockZ()
);
pos1 = myregion.getMinimumPoint();
pos2 = myregion.getMaximumPoint();
} else {
return new FaweMask(adapt(myregion)) {
@Override