From d4d7cfeb325afdc6cdbe9d96df19fb30c6c5cddd Mon Sep 17 00:00:00 2001 From: Simon Chuu Date: Sat, 11 Aug 2018 03:57:16 -0400 Subject: [PATCH] Fix issue when loading plugin while server is up (e.g. using PlugMan). Release 1.0.2 --- build.gradle | 2 +- src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c13883d..2fa1f21 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'com.simonorj.mc.phantomsmp' -version '1.0.1' +version '1.0.2' sourceCompatibility = 1.8 diff --git a/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java b/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java index 3ef5b19..a4f3031 100644 --- a/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java +++ b/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java @@ -38,6 +38,10 @@ public class PhantomSMP extends JavaPlugin { this.phantomPlayerMap = new HashMap<>(); this.removeTargetingRested = getConfig().getBoolean("remove-targeting-rested", true); + for (Player p : getServer().getOnlinePlayers()) { + this.playerPhantomMap.put(p, new LinkedHashSet<>()); + } + // Initiate map for (World w : getServer().getWorlds()) { if (w.getEnvironment() != World.Environment.NORMAL)