added a stupid check because of a spigot issue.

This commit is contained in:
MattBDev 2019-08-19 14:51:14 -04:00
parent a63f8650e5
commit ec84b91f84
3 changed files with 13 additions and 12 deletions

View File

@ -22,21 +22,17 @@ public class DebugRoadRegen extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
if (args.length < 1) {
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
DebugRoadRegen.USAGE);
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
return false;
}
String kind = args[0].toLowerCase();
switch (kind) {
case "plot":
return regenPlot(player);
case "region":
return regenRegion(player, Arrays.copyOfRange(args, 1, args.length));
default:
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
DebugRoadRegen.USAGE);
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
return false;
}
}

View File

@ -17,7 +17,6 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
public class Unlink extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
Location location = player.getLocation();
final Plot plot = location.getPlotAbs();
if (plot == null) {

View File

@ -22,9 +22,8 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.Nullable;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
@ -875,8 +874,15 @@ public class Plot {
}
Plot current = queue.poll();
if (Plot.this.area.TERRAIN != 0) {
ChunkManager.manager
.regenerateRegion(current.getBottomAbs(), current.getTopAbs(), false, this);
try {
ChunkManager.manager
.regenerateRegion(current.getBottomAbs(), current.getTopAbs(), false,
this);
} catch (UnsupportedOperationException exception) {
MainUtil.sendMessage(null,
"Please ask md_5 to fix regenerateChunk() because it breaks plugins. We apologize for the inconvenience");
return;
}
return;
}
manager.clearPlot(current, this);
@ -930,8 +936,8 @@ public class Plot {
/**
* Unlink the plot and all connected plots.
*
* @param createSign whether to recreate signs
* @param createRoad whether to recreate road
* @param createSign whether to recreate signs
* @return success/!cancelled
*/
public boolean unlinkPlot(boolean createRoad, boolean createSign) {