From ec84b91f846bb92700f1003e4fb6c4abf3613362 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 19 Aug 2019 14:51:14 -0400 Subject: [PATCH] added a stupid check because of a spigot issue. --- .../plot/commands/DebugRoadRegen.java | 8 ++------ .../plotsquared/plot/commands/Unlink.java | 1 - .../plotsquared/plot/object/Plot.java | 16 +++++++++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java index 9cc80adb4..a268f8903 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java @@ -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; } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java index 4805c75e7..0ac65184a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java @@ -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) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 77b60b456..27a04e402 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -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) {