From 6711788dd04915b63f80ab694d7d23e3b4074d94 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 6 Feb 2019 16:38:01 +0000 Subject: [PATCH] Fix ClassCastException in runEntityTask --- .../intellectualsites/plotsquared/bukkit/BukkitMain.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index d58443025..1580d8d09 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -365,8 +365,12 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain if (meta.isEmpty()) { continue; } - Plot origin = (Plot) meta.get(0).value(); - if (!plot.equals(origin.getBasePlot(false))) { + PlotId originPlotId = (PlotId) meta.get(0).value(); + if (originPlotId == null) { + iterator.remove(); + entity.remove(); + } + if (!plot.getId().equals(originPlotId)) { if (entity.hasMetadata("ps-tmp-teleport")) { continue; }