andune / HomeSpawnPlus

Home/Spawn control plugin for Bukkit
GNU General Public License v3.0
13 stars 10 forks source link

spawnWorldRandom not working anymore #28

Closed Zedd7 closed 9 years ago

Zedd7 commented 9 years ago

Hi, I'm using HSP since a while now and I particulary like the random spawning feature.

But since I updated HSP to 2.0 beta 1,2 and 3, this stopped working. Now the portals linked with HSP behave like standart portals.

Here are the console logs : http://pastebin.com/XmSWqxtx

We can see that both WorldBorder and MultiversePortals are loading fine, but HSP didn't linked with WorldBorder.

Here are the concerned parts of my config (core and events are separated in two config files) : http://pastebin.com/m400t0mi

So, is it a fail in my config or a bug in HSP ?

Thanks for fixing/helping, Z3dd7.

andune commented 9 years ago

Odd that it didn't link with WorldBorder. From your logs I can see v1.8.1 of WorldBorder, I'll download that and give it a test to see why it's not integrating properly.

However, that's a total aside to your actual issue, I think. You say the strategies aren't working at all, which indicates a problem with the portal detection and MultiVerse. I'll recreate a test scenario similar to yours and see if I can get it working or debug what's broken (I know MultiVerse has had a few new revs so maybe the code has changed).

Once we get that working, then WorldBorder integration will become an issue since HSP will just assume a +/- 1000 radius as the messages say. We'll take this one at a time and get the MV integration working first. I'll let you know what I find from my tests.

Zedd7 commented 9 years ago

Ok thanks, tell me if I must test specifical features on my server ;)

andune commented 9 years ago

Just to keep you updated, from checking I did last night I'm pretty sure this is being caused by a bug where HSP is not picking up the SourcePortal during the Multiverse teleport process.

I will do some more testing later as to why this is happening. It's a good thing if this is an HSP bug since I can easily reproduce the test scenario and that means I have everything I need to fix the problem.

andune commented 9 years ago

Should be fixed as of build 596 on Jenkins

Zedd7 commented 9 years ago

Well, with build 598, HSP is noticing MVP but there are still a few errors in console while HSP is trying to find a safe spot :p

pastebin : http://pastebin.com/7zH7N9cP

After a freeze of 4-5 seconds, the player is teleported to the spawn of the target world, instead of a random point.

andune commented 9 years ago

Odd. Do you know any details about the teleport that caused this? HSP's safe teleport algorithm works like so:

Given Location x=0,y=40,z=0

  1. HSP will check in cocentric cubes around base location looking for a safe spot, up to 10 blocks.
  2. If it doesn't find one, it will then check for x=0,z=0,y=[Highest-Y] where [Highest-Y] is Bukkit's call to ".getHighestBlockAt()", the intention being to teleport players to the surface directly above the intended teleport spot if they were teleporting into solid rock.
  3. It protects against [Highest-Y] = 0 (for empty worlds) to prevent infinite loop
  4. It protects against infinite [Highest-Y] loop by checking to make sure the newly found Highest is actually higher than the loop we just went through.

What is happening in your case is it is infinitely looping around 4. That is, it's not finding a safe location at the original location, HSP then tries to move to [Highest-Y] and check. It's not finding one there either, and somehow is not triggering the protection in step 4 and so loops again. And again. And again.

I don't know what condition in your world is causing this, so some info would be very helpful for me to reproduce the situation and fix the loop. Right now all the logic checks out to me so this looping should be impossible, yet clearly it's happening on your server somehow.

andune commented 9 years ago

Do you have maps that are higher than 255 blocks?

Zedd7 commented 9 years ago

I don't know what could be causing this :/

I have 3 portals linked with HSP's spawnWorldRandom on my server :

Freebuild has nothing special : it's a 5000x5000 map generated in 1.6 using multiverse (here is the MV file for Freebuild : http://pastebin.com/Zcp52gG6) with max height of y=255.

You can view it on the dynmap : http://www.reborn-minecraft.eu:8123/?worldname=Freebuild&mapname=surface&zoom=0&x=804&y=64&z=271

Tell me if you need more info. But what is weird is that HSP was working fine on this map before updating to 2.0..

andune commented 9 years ago

I've coded a fix in build 599. Give it a try and please report back if you see this error again.

Zedd7 commented 9 years ago

With build 999 the bug seems to be fixed !

Some errors showed up in console once but the player was teleported successfully. Everything went fine with all other tests.

Well thanks for the fix, I'll create some more tickets for other bugs / missing features I noticed since 2.0 :p