diff --git a/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java b/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java index f2913233c..99535ff27 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java +++ b/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java @@ -1,16 +1,22 @@ package com.intellectualcrafters.plot.util; -import com.intellectualcrafters.plot.PS; -import com.intellectualcrafters.plot.flag.Flag; -import com.intellectualcrafters.plot.flag.FlagManager; -import com.intellectualcrafters.plot.object.*; -import com.plotsquared.bukkit.listeners.PlayerBlockEventType; -import com.plotsquared.bukkit.util.SetupUtils; - import java.util.ArrayList; import java.util.HashSet; import java.util.UUID; +import com.intellectualcrafters.plot.PS; +import com.intellectualcrafters.plot.flag.Flag; +import com.intellectualcrafters.plot.flag.FlagManager; +import com.plotsquared.bukkit.listeners.PlayerBlockEventType; +import com.intellectualcrafters.plot.object.LazyBlock; +import com.intellectualcrafters.plot.object.Location; +import com.intellectualcrafters.plot.object.Plot; +import com.intellectualcrafters.plot.object.PlotBlock; +import com.intellectualcrafters.plot.object.PlotCluster; +import com.intellectualcrafters.plot.object.PlotId; +import com.intellectualcrafters.plot.object.PlotPlayer; +import com.plotsquared.bukkit.util.SetupUtils; + public abstract class EventUtil { public static EventUtil manager = null; diff --git a/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEventUtil.java b/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEventUtil.java index 5f91be408..7444cca48 100644 --- a/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEventUtil.java +++ b/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEventUtil.java @@ -16,7 +16,10 @@ import java.util.UUID; public class BukkitEventUtil extends EventUtil { public Player getPlayer(PlotPlayer player) { - return ((BukkitPlayer) player).player; + if (player instanceof BukkitPlayer) { + return ((BukkitPlayer) player).player; + } + return null; } public boolean callEvent(Event event) {