mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 08:30:59 +00:00
Found root cause of why spawn-near-players wasn't working. getOnlinePlayers gets from all worlds; for a server with nether, end, etc. those players can also be selected, but ultimately the player will spawn in the overworld but near the coords of that invisible player in the other world. So, replaced with world.getPlayers to prevent that.
This commit is contained in:
@@ -91,8 +91,7 @@ public class RandomSpawn extends JavaPlugin{
|
||||
blacklist = yamlHandler.worlds.getIntegerList(worldName + ".spawnblacklist");
|
||||
|
||||
if(yamlHandler.worlds.getBoolean(worldName + ".spawnbyplayer")) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Player> playersOnline = (List<Player>) Bukkit.getOnlinePlayers();
|
||||
List<Player> playersOnline = (List<Player>) world.getPlayers();
|
||||
|
||||
if(playersOnline.size() > 0) {
|
||||
Player randomPlayer = playersOnline.get((int)(Math.random() * playersOnline.size()));
|
||||
|
||||
Reference in New Issue
Block a user