mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Allow specific P2 queue hooks to be disabled
This commit is contained in:
@ -16,7 +16,6 @@ import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
@ -62,6 +61,9 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public boolean setCuboids(final PlotArea area, final Set<CuboidRegion> regions, final Pattern blocks, final int minY, final int maxY) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.CUBOIDS) {
|
||||
return parent.setCuboids(area, regions, blocks, minY, maxY);
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweRegionManager.class) {
|
||||
World world = BukkitAdapter.adapt(getWorld(area.getWorldName()));
|
||||
@ -83,7 +85,7 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public boolean notifyClear(PlotManager manager) {
|
||||
if (!(manager instanceof HybridPlotManager)) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.CLEAR || !(manager instanceof HybridPlotManager)) {
|
||||
return false;
|
||||
}
|
||||
final HybridPlotWorld hpw = ((HybridPlotManager) manager).getHybridPlotWorld();
|
||||
@ -92,7 +94,7 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public boolean handleClear(final Plot plot, final Runnable whenDone, final PlotManager manager) {
|
||||
if (!(manager instanceof HybridPlotManager)) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.CLEAR || !(manager instanceof HybridPlotManager)) {
|
||||
return false;
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
@ -123,7 +125,7 @@ public class FaweRegionManager extends RegionManager {
|
||||
Region airRegion = new CuboidRegion(pos1.withY(hybridPlotWorld.PLOT_HEIGHT + 1),
|
||||
pos2.withY(manager.getWorldHeight()));
|
||||
|
||||
Clipboard clipboard = new BlockArrayClipboard(new CuboidRegion(pos1, pos2));
|
||||
Clipboard clipboard = new BlockArrayClipboard(new CuboidRegion(pos1.withY(0), pos2.withY(255)));
|
||||
|
||||
clipboard.setBlocks(bedrockRegion, bedrock);
|
||||
clipboard.setBlocks(fillingRegion, filling);
|
||||
@ -162,6 +164,9 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public void swap(final Location pos1, final Location pos2, final Location pos3, final Location pos4, final Runnable whenDone) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.COPY_AND_SWAP) {
|
||||
parent.swap(pos1, pos2, pos3, pos4, whenDone);
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweRegionManager.class) {
|
||||
//todo because of the following code this should proably be in the Bukkit module
|
||||
@ -190,6 +195,9 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public void setBiome(CuboidRegion region, int extendBiome, BiomeType biome, String world, Runnable whenDone) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.SET_BIOME) {
|
||||
parent.setBiome(region, extendBiome, biome, world, whenDone);
|
||||
}
|
||||
region.expand(BlockVector3.at(extendBiome, 0, extendBiome));
|
||||
region.expand(BlockVector3.at(-extendBiome, 0, -extendBiome));
|
||||
TaskManager.IMP.async(() -> {
|
||||
@ -210,6 +218,9 @@ public class FaweRegionManager extends RegionManager {
|
||||
|
||||
@Override
|
||||
public boolean copyRegion(final Location pos1, final Location pos2, final Location pos3, final Runnable whenDone) {
|
||||
if (!com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_INTEGRATION.COPY_AND_SWAP) {
|
||||
return parent.copyRegion(pos1, pos2, pos3, whenDone);
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweRegionManager.class) {
|
||||
World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorld()));
|
||||
|
@ -39,7 +39,7 @@ public class PlotSquaredFeature extends FaweMaskManager {
|
||||
public PlotSquaredFeature() {
|
||||
super("PlotSquared");
|
||||
log.debug("Optimizing PlotSquared");
|
||||
if (com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_HOOK) {
|
||||
if (com.boydti.fawe.config.Settings.IMP.ENABLED_COMPONENTS.PLOTSQUARED_HOOK) {
|
||||
Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS = false;
|
||||
try {
|
||||
setupBlockQueue();
|
||||
|
@ -2,6 +2,7 @@ package com.boydti.fawe.bukkit.regions.plotsquaredv4;
|
||||
|
||||
import static org.bukkit.Bukkit.getWorld;
|
||||
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.util.EditSessionBuilder;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
@ -49,6 +50,9 @@ public class FaweChunkManager extends ChunkManager {
|
||||
|
||||
@Override
|
||||
public void swap(final Location pos1, final Location pos2, final Location pos3, final Location pos4, final Runnable whenDone) {
|
||||
if (!Settings.IMP.PLOTSQUARED_INTEGRATION.COPY_AND_SWAP) {
|
||||
parent.swap(pos1, pos2, pos3, pos4, whenDone);
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweChunkManager.class) {
|
||||
//todo because of the following code this should proably be in the Bukkit module
|
||||
@ -77,6 +81,9 @@ public class FaweChunkManager extends ChunkManager {
|
||||
|
||||
@Override
|
||||
public boolean copyRegion(final Location pos1, final Location pos2, final Location pos3, final Runnable whenDone) {
|
||||
if (!Settings.IMP.PLOTSQUARED_INTEGRATION.COPY_AND_SWAP) {
|
||||
return parent.copyRegion(pos1, pos2, pos3, whenDone);
|
||||
}
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweChunkManager.class) {
|
||||
World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorld()));
|
||||
|
@ -41,7 +41,7 @@ public class PlotSquaredFeature extends FaweMaskManager {
|
||||
public PlotSquaredFeature() {
|
||||
super("PlotSquared");
|
||||
log.debug("Optimizing PlotSquared");
|
||||
if (com.boydti.fawe.config.Settings.IMP.PLOTSQUARED_HOOK) {
|
||||
if (com.boydti.fawe.config.Settings.IMP.ENABLED_COMPONENTS.PLOTSQUARED_HOOK) {
|
||||
Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS = false;
|
||||
try {
|
||||
setupBlockQueue();
|
||||
|
Reference in New Issue
Block a user