Ignore new chunks on chunk load event

This commit is contained in:
Simon Chuu 2019-05-29 02:50:48 -04:00
parent eeeac813e7
commit d535203a48
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ public class PhantomListener implements Listener {
private static final String DISALLOW_SPAWN_PERM = "phantomsmp.disallowspawn";
private static final String IGNORE_PERM = "phantomsmp.ignore";
private final Map<Player, LinkedHashSet<Phantom>> playerPhantomMap = new HashMap<>();
private final Map<Player, Set<Phantom>> playerPhantomMap = new HashMap<>();
private final Map<Phantom, Player> phantomPlayerMap = new HashMap<>();
private final Set<Phantom> newPhantom = new LinkedHashSet<>();
private final PhantomSMP plugin;
@ -182,7 +182,7 @@ public class PhantomListener implements Listener {
@EventHandler
public void onPhantomInLoadedChunk(ChunkLoadEvent e) {
if (e.getWorld().getEnvironment() != World.Environment.NORMAL)
if (e.isNewChunk() || e.getWorld().getEnvironment() != World.Environment.NORMAL)
return;
for (Entity ent : e.getChunk().getEntities())