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) { @Override public boolean onCommand(PlotPlayer player, String[] args) {
if (args.length < 1) { if (args.length < 1) {
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
DebugRoadRegen.USAGE);
return false; return false;
} }
String kind = args[0].toLowerCase(); String kind = args[0].toLowerCase();
switch (kind) { switch (kind) {
case "plot": case "plot":
return regenPlot(player); return regenPlot(player);
case "region": case "region":
return regenRegion(player, Arrays.copyOfRange(args, 1, args.length)); return regenRegion(player, Arrays.copyOfRange(args, 1, args.length));
default: default:
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
DebugRoadRegen.USAGE);
return false; return false;
} }
} }

View File

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

View File

@ -22,9 +22,8 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.awt.geom.Area; import java.awt.geom.Area;
import java.awt.geom.PathIterator; import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@ -875,8 +874,15 @@ public class Plot {
} }
Plot current = queue.poll(); Plot current = queue.poll();
if (Plot.this.area.TERRAIN != 0) { if (Plot.this.area.TERRAIN != 0) {
try {
ChunkManager.manager ChunkManager.manager
.regenerateRegion(current.getBottomAbs(), current.getTopAbs(), false, this); .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; return;
} }
manager.clearPlot(current, this); manager.clearPlot(current, this);
@ -930,8 +936,8 @@ public class Plot {
/** /**
* Unlink the plot and all connected plots. * Unlink the plot and all connected plots.
* *
* @param createSign whether to recreate signs
* @param createRoad whether to recreate road * @param createRoad whether to recreate road
* @param createSign whether to recreate signs
* @return success/!cancelled * @return success/!cancelled
*/ */
public boolean unlinkPlot(boolean createRoad, boolean createSign) { public boolean unlinkPlot(boolean createRoad, boolean createSign) {