From a50e337224090e825755e14356730ef65c79df53 Mon Sep 17 00:00:00 2001 From: Wyatt Childers Date: Thu, 14 Apr 2016 21:55:15 -0400 Subject: [PATCH] A player is not always present when the InteractBlockEvent is fired anymore --- .../main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index d6882cb7f..e9a8fa208 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -146,6 +146,10 @@ public class SpongeWorldEdit { WorldEdit we = WorldEdit.getInstance(); Optional optPlayer = event.getCause().get(NamedCause.SOURCE, Player.class); + if (!optPlayer.isPresent()) { + return; + } + SpongePlayer player = wrapPlayer(optPlayer.get()); com.sk89q.worldedit.world.World world = player.getWorld();