HomeSpawnPlus

HomeSpawnPlus

342k Downloads

Server spawn

antoine7 opened this issue ยท 7 comments

commented

Hello

Ive a server with a Lobby and a world

Plugins :
PopulationDensity
Multiverse
Worldguard
Homespawnplus.

I would like the first joiners spawn at lobby but whatever I do they always spawn at the main world spawn.

I ve setup
In multiverse config :
firstspawnoverride: 'true'
firstspawnworld: Lobby

In homespawn plus

defaultWorld: world
override_world: false

I deleted player data for my char "Alzou" and relogged ( I was at lobby) and I spawn in the wild on the main world.

Help please

[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] New player Alzou detected.
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] Attempting to respawn player Alzou (joining).
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onnewplayer player={BukkitPlayer:Alzou}
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onjoin player={BukkitPlayer:Alzou}
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus](strategy spawnNewPlayer) player is detemined to be a new player
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus](strategy spawnNewPlayer) result is [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@43eb39b1}]
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] Evaluation chain complete, result = [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@43eb39b1}]
[19:14:49] [Server thread/INFO]: [HomeSpawnPlus] result changed to safeLocation, new result = [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@43eb39b1}]

commented

Hi thank you for posting so quickly

I am really sorry but yesterday after posting this, I was for one hour trying many setup and this morning IT WORKS. Big surprise !
However I copy the log here may be it can help to understand.

The main thing changed I guess is in homespawnplus config :

The default/main world. Strategies reference this as the default

world, you can change that here if you like.

defaultWorld: lobby

I dont know if it will make problems that I changed this from world to lobby

I installed SwissArmyKnife but I see the output only in game not in logs. My console is buggy on my provider site so I cant launch from it.

Essentials VTeamcity has HIGHEST Priority and Homespawnplus LOWEST (may be I changed it yesterday)
.

[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] New player Alzou detected.
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Attempting to respawn player Alzou (joining).
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onnewplayer player={BukkitPlayer:Alzou}
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onjoin player={BukkitPlayer:Alzou}
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus](strategy spawnNewPlayer) player is detemined to be a new player
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus](strategy spawnNewPlayer) result is [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@4e7e5364}]
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Evaluation chain complete, result = [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@4e7e5364}]
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] result changed to safeLocation, new result = [loc={lobby,-125,18,-51}, home=null, spawn={com.andune.minecraft.hsp.entity.SpawnImpl$$EntityBean$HomeSpawnPlus@4e7e5364}]
[06:28:17] [Server thread/INFO]: Alzou[/90.23.142.27:51165] logged in with entity id 259923 at ([world]-17.5, -1.0, 266.5)
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=crossworldteleport player={BukkitPlayer:Alzou}
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus](strategy default) result is [loc={null}, home=null, spawn={null}]
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Evaluation chain complete, result = explicit default
[06:28:17] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onteleportobserve player={BukkitPlayer:Alzou}
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=crossworldteleport player={BukkitPlayer:Alzou}
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus](strategy default) result is [loc={null}, home=null, spawn={null}]
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Evaluation chain complete, result = explicit default
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onteleportobserve player={BukkitPlayer:Alzou}
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=crossworldteleport player={BukkitPlayer:Alzou}
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus
HomeSpawnPlus](strategy default) result is [loc={null}, home=null, spawn={null}]
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Evaluation chain complete, result = explicit default
[06:28:18] [Server thread/INFO]: [HomeSpawnPlus] Strategy evaluation started, type=onteleportobserve player={BukkitPlayer:Alzou}

TEST
AFTER this log I tried to change the homespawnplus priority to HIGHEST but I have the same result I spawn in Lobby !

NEW TEST

I changed the HomeSpawnPlus config :

The default/main world. Strategies reference this as the default

world, you can change that here if you like.

defaultWorld: world

AND NOW IT DOESNT WORK !! I SPAWN IN THE WILD

So.... I have to set defaultWorld = lobby to spawn again first joiners in lobby

Am I going to deal with problems with this setup ?

But I am happy it works

Thanks for your awesome plugin !!

commented

Interesting. Thank you for using verboseLogging and including the output - we can see that HSP is indeed detecting you as a new player and sending you to your firstSpawn location on world lobby.

So what is most likely happening is that some other plugin is then overriding HSP and sending you somewhere else.

HSP has detection code for this possibility on respawn events and will print a warning message if it sees another plugin moving the player elsewhere, and I thought it had it onJoin as well, but I just checked the code and don't see it. In any case, all that would tell us is that some other plugin (unknown) is teleporting the player away, which we already know from the messages you are seeing.

I built a plugin called SwissArmyKnife to allow you to view Bukkit event chains to make finding issues like this easier, but BukkitDev disabled it as inactive and it got lost on Jenkins when I upgraded. I'll see about getting it built on Jenkins so you can do more troubleshooting, but in the mean time the easiest thing is to disable other plugins one at a time until the behavior goes away. Then you know which plugin is overriding HSP and can work to fix it.

commented

Alright I have SwissArmyKnife uploaded to Jenkins now. It has a few commands, one is '/eld' which will show you all event listeners (best to use from console, it's very verbose).

For your purposes, however, the command you are interested in is '/ev' which will dump all event listeners for a given event. It does a regex match, so '/ev Join' will match "PlayerJoinEvent" and show you all plugins listening to that event. Here's sample output from my test server:

>ev Join
[17:47:46 INFO]: class org.bukkit.event.player.PlayerJoinEvent:
[17:47:46 INFO]:   Listener 0: Plugin "PermissionsEx v1.23.2" [priority LOWEST]
[17:47:46 INFO]:   Listener 1: Plugin "PlugMan v2.0.4" [priority NORMAL]
[17:47:46 INFO]:   Listener 2: Plugin "PermissionsEx v1.23.2" [priority NORMAL]
[17:47:46 INFO]:   Listener 3: Plugin "The Multiverse-Core Plugin" [priority NORMAL]
[17:47:46 INFO]:   Listener 4: Plugin "iConomy v7.0" [priority NORMAL]
[17:47:46 INFO]:   Listener 5: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 6: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 7: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 8: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 9: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 10: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority NORMAL]
[17:47:46 INFO]:   Listener 11: Plugin "WorldGuard v6.0.0-SNAPSHOT.1488-" [priority NORMAL]
[17:47:46 INFO]:   Listener 12: Plugin "CommandBook v2.5-SNAPSHOT.1762-" [priority HIGH]
[17:47:46 INFO]:   Listener 13: Plugin "HomeSpawnPlus v2.0.1-SNAPSHOT-b20150407-2317" [priority HIGHEST]
[17:47:46 INFO]:   Listener 14: Plugin "Vault v1.5.2-b33" [priority MONITOR]

They are sorted in order from lowest->highest and you can see, with the exception of Vault listening at MONITOR priority, HSP is the highest and so should have final say.

However, there is one caveat with PlayerJoinEvent in particular - Bukkit has no API for setting the teleport destination, as it does with other events. So every plugin that offers control over login location does so by adding a scheduled event to run a few tics after player login and then doing the teleport. In this case, the plugin which has the longest tick delay wins. For example, if HSP does this teleport after 2 tics (it does), but MultiVerse does it after, say, 5 tics, then multiverse would "win". There is no way to see this with SwissArmyKnife, but at least you'll know the plugins listening to PlayerJoinEvent that could be considered possible culprits.

Additionally, it turns out I was wrong: HSP DOES have detection code for onJoin, you'll see a warning of the format: "log.info("onJoin: final player location is different than where "+plugin.getName()+" sent player, another plugin has changed the location."

However, this warning is scheduled to fire after 5 tics of HSP's teleport, so if the offending plugin is waiting a full second (20 tics), HSP's warning won't see it to alert you.

commented

Ok It doesnt work. My players cant use /home anymore :(

Help please

commented

Zip/tar up your config directory and upload it somewhere that I can download.

Then describe (in words) what it is you are trying to accomplish: new players spawn (here), when players type /home, XYZ happens, etc. I will take a look at your configs and to help you make sure it is doing what you intend.

commented

Login to your server and go to the place on world WELCOME where you want new player to spawn and run "/setfirstspawn". At this point, you should be able to move away and type "/spawn newPlayerSpawn" and you will be taken to the spawn you just set.

Once this is completed and verified, your current event chain for "onJoin" which includes "spawnNewPlayer" as the first strategy, should work regardless of the defaultWorld setting. If it's not working, you most likely have a plugin conflict. A simple way to test/confirm a plugin conflict is to change onJoin to something like so:

events:
  onJoin:
    - spawnNamedSpawn:foo

Then go "/setspawn foo" somewhere. Now every time you, or anyone else logs in, you will be sent to that spawn point. If this works, then you have a working HSP installation without plugin conflicts and getting everything else you want working should be pretty easy. If this doesn't work as you expect, then you have some other plugin controlling login behavior and you need to get that under control first.