HomeSpawnPlus

HomeSpawnPlus

342k Downloads

NPE: Home strategy

Feeriix opened this issue ยท 4 comments

commented

http://pastebin.com/RL7RGTBG
image

No issue if the stategy works.

Strategy:
onHomeCommand:
- modeDistanceLimits:0;200
- modeRequiresBed
- homeLocalWorld

Using: Spigot 1.8 protocol hack. HSP v1.7.8
Can this be fixed in v2? Thanks for keeping the plugin up to date!

commented

The latest version of HSP 2.0 on Jenkins (build 566 as of this writing) is drop-in compatible with HSP 1.7.8 if you're using sqlLite. If you're using MySQL, keep an eye on issue #16 before trying to use 2.0.

Assuming sqlLite, backup your database (always better to be safe) and then drop in HSP 2.0. Read the upgrade notes here on the wiki, you'll immediately get some new features like uber commands. But your existing config.yml will continue to work, so you can test if this issue is fixed in 2.0. If it is, feel free to use 2.0 and report any other bugs you find. If the issue still happens in 2.0, then please file a report with the stack trace from 2.0 and I should be able to figure out what's going on and get it fixed.

At any time if 2.0 is giving you issues that make it unusable, you can just drop the 1.7 JAR back in and continue on your way, but I would be grateful if you could report any issues you do run in to so that I can get them fixed and get people functional and bug-free on 2.0 sooner rather than later!

commented

The NPE seems to be fixed but now the modeDistanceLimits strategy doesn't work. I get a "No home found" message when I am standing near the home location.

Can you also create a new locale message option for being too far from the home? Would be nice to let players know what's wrong. Thanks.

Using build #568.

commented

Should be fixed in build 569.

Regarding a message, not really.. the way the mode is designed is it modifies other strategies, so if it "fails" HSP just falls through to the next strategy. Printing a message might not be the desired behavior since you might have several strategies you check and don't want them all messaging the player.

However, HSP 2.0 does have a new "message" strategy that you could use for this purpose. This gets a bit tricky since HSP strategies aren't turing complete, so you can't do if/then/else type stuff, but with some clever design work on your strategies you can usually get what you want. Here's an example:

onDeath:
- modeDistanceLimits:0;100
- homeLocalWorld
- message:You are too far away from any of your homes, you must be within 100 blocks. Sending you to spawn.
- modeDefault
- spawnLocalWorld

The player will only ever see the message in the event that homeLocalWorld doesn't succeed in finding a home.

commented

Thanks for the quick fix. The message strategy seems interesting, will try it out now.