From 7eb487aef7e6ef9635d47eb774bf501d148d1dbc Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 31 Jul 2014 16:41:40 -0700 Subject: [PATCH] [Forge] Better handle null platform field in ForgeWorldEdit. --- .../java/com/sk89q/worldedit/forge/ForgeWorldEdit.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index d0d6f0104..cd44eaa20 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -106,7 +106,7 @@ public class ForgeWorldEdit { } @EventHandler - public void serverAboutToSTart(FMLServerAboutToStartEvent event) { + public void serverAboutToStart(FMLServerAboutToStartEvent event) { if (this.platform != null) { logger.warning("FMLServerStartingEvent occurred when FMLServerStoppingEvent hasn't"); WorldEdit.getInstance().getPlatformManager().unregister(platform); @@ -144,6 +144,11 @@ public class ForgeWorldEdit { @ForgeSubscribe public void onPlayerInteract(PlayerInteractEvent event) { + if (platform == null) { + logger.warning("WorldEdit didn't initialize correctly! Please report this error."); + return; + } + if (!platform.isHookingEvents()) return; // We have to be told to catch these events if (event.useItem == Result.DENY || event.entity.worldObj.isRemote) return;