diff --git a/build.gradle b/build.gradle index 81d2af1..c31de64 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'forge' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' -version = "1.7" +version = "1.8" group= "com.gamerforea" archivesBaseName = "EventHelper" diff --git a/src/main/java/com/gamerforea/eventhelper/fake/FakePlayerContainer.java b/src/main/java/com/gamerforea/eventhelper/fake/FakePlayerContainer.java index 45cc0b4..6e5a821 100644 --- a/src/main/java/com/gamerforea/eventhelper/fake/FakePlayerContainer.java +++ b/src/main/java/com/gamerforea/eventhelper/fake/FakePlayerContainer.java @@ -69,7 +69,8 @@ public final void setRealPlayer(EntityPlayer player) if (player != null) { this.profile = player.getGameProfile(); - this.realPlayer = new WeakReference(player); + if (!(player instanceof FakePlayer)) + this.realPlayer = new WeakReference(player); } } diff --git a/src/main/java/com/gamerforea/eventhelper/wg/WGReflection.java b/src/main/java/com/gamerforea/eventhelper/wg/WGReflection.java index 92edb41..e7b84c7 100644 --- a/src/main/java/com/gamerforea/eventhelper/wg/WGReflection.java +++ b/src/main/java/com/gamerforea/eventhelper/wg/WGReflection.java @@ -4,6 +4,7 @@ import org.bukkit.plugin.Plugin; +import com.google.common.base.Preconditions; import com.google.common.io.ByteStreams; public final class WGReflection @@ -13,6 +14,7 @@ public final class WGReflection public static final void setWG(Plugin plugin) { + Preconditions.checkNotNull(plugin, "WorldGuard not installed!"); wgPlugin = plugin; wgClassLoader = plugin.getClass().getClassLoader(); }