From fed516972485be7fed34af2e1292d27041a49d30 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 5 Nov 2019 15:23:48 +0000 Subject: [PATCH] Get sign lines sync --- .../plotsquared/bukkit/util/BukkitUtil.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index a6f49ca66..bf7ed114a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -8,6 +8,7 @@ import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.sk89q.worldedit.bukkit.BukkitWorld; @@ -312,13 +313,15 @@ import java.util.Set; } @Override @Nullable public String[] getSign(@NonNull final Location location) { - Block block = getWorld(location.getWorld()) - .getBlockAt(location.getX(), location.getY(), location.getZ()); - if (block.getState() instanceof Sign) { - Sign sign = (Sign) block.getState(); - return sign.getLines(); - } - return null; + Block block = getWorld(location.getWorld()).getBlockAt(location.getX(), location.getY(), location.getZ()); + return TaskManager.IMP.sync(new RunnableVal() { + @Override public void run(String[] value) { + if (block.getState() instanceof Sign) { + Sign sign = (Sign) block.getState(); + this.value = sign.getLines(); + } + } + }); } @Override public Location getSpawn(@NonNull final PlotPlayer player) {