From 3473f5dc851a06baab01049e832a7f6312ba20eb Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Wed, 14 Aug 2019 20:47:01 -0400 Subject: [PATCH] Fixed compatibility with FAWE and compile issue. --- .../bukkit/events/PlotAutoMergeEvent.java | 2 +- .../plotsquared/bukkit/events/PlotUnlinkEvent.java | 2 +- .../plotsquared/plot/database/SQLManager.java | 4 ++-- .../plot/util/block/BasicLocalBlockQueue.java | 1 + .../plot/util/block/DelegateLocalBlockQueue.java | 1 + .../plot/util/block/LocalBlockQueue.java | 8 ++++++++ .../plotsquared/plot/database/AbstractDBTest.java | 14 +++++++++++--- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java index d30aa5770..059b296cf 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java @@ -7,8 +7,8 @@ import lombok.Setter; import org.bukkit.World; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java index 77566c70c..5db7d04d4 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java @@ -8,8 +8,8 @@ import org.bukkit.World; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index b3b20379f..2f041cc57 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -2942,7 +2942,7 @@ import java.util.concurrent.atomic.AtomicInteger; boolean[] pm = plot.getMerged(); boolean[] dm = dataPlot.getMerged(); if (pm[0] != dm[0] || pm[1] != dm[1]) { - PlotSquared.debug("&8 - &7Correcting merge for: " + plot); + PlotSquared.debug(" - Correcting merge for: " + plot); setMerged(dataPlot, plot.getMerged()); } HashMap, Object> pf = plot.getFlags(); @@ -2951,7 +2951,7 @@ import java.util.concurrent.atomic.AtomicInteger; if (pf.size() != df.size() || !StringMan .isEqual(StringMan.joinOrdered(pf.values(), ","), StringMan.joinOrdered(df.values(), ","))) { - PlotSquared.debug("&8 - &7Correcting flags for: " + plot); + PlotSquared.debug(" - Correcting flags for: " + plot); setFlags(plot, pf); } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java index 6b5d625d7..6993c3208 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java @@ -23,6 +23,7 @@ public abstract class BasicLocalBlockQueue extends LocalBlockQueue { private int lastZ = Integer.MIN_VALUE; public BasicLocalBlockQueue(String world) { + super(world); this.world = world; this.modified = System.currentTimeMillis(); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java index 5c2a8fb48..a89597fcf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java @@ -8,6 +8,7 @@ public class DelegateLocalBlockQueue extends LocalBlockQueue { private final LocalBlockQueue parent; public DelegateLocalBlockQueue(LocalBlockQueue parent) { + super(parent.getWorld()); this.parent = parent; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java index 852505d74..fd921c18c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java @@ -16,6 +16,14 @@ import java.util.Map; public abstract class LocalBlockQueue { + /** + * Needed for compatibility with FAWE. + * + * @param world unused + */ + @Deprecated public LocalBlockQueue(String world) { + } + public ScopedLocalBlockQueue getForChunk(int x, int z) { int bx = x << 4; int bz = z << 4; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java index 944aa6cab..a2cc07d1b 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java @@ -1,11 +1,19 @@ package com.github.intellectualsites.plotsquared.plot.database; import com.github.intellectualsites.plotsquared.plot.flag.Flag; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.comment.PlotComment; +import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class AbstractDBTest implements AbstractDB {