Giter Club home page Giter Club logo

Comments (10)

andune avatar andune commented on August 20, 2024

Interesting error report. While in the 2.0 branch I have laid the foundation for supporting non-Bukkit servers, I've not ever tested HSP with anything other than CraftBukkit, especially on the current 1.7.x releases, so your results may vary. I am glad to hear turning safeTeleport off resolves the issue.

I can't promise to look into the issue in any detail, at this time I only officially support CraftBukkit and even that I barely keep up with as I don't play or follow the MC/Bukkit community anymore and haven't for some months now; I do still try to keep my plugins up-to-date or help troubleshoot things as I can.

That all said, if you have a stack trace you can share of the issue, that might hint at the problem and perhaps I can fix it (might be related to blockIds > 255, for example). I don't have MCPC running to test with, but if you're willing to do some leg work to bring me logs and try out dev versions, I'll see what I can do to help out.

Also, if you're tied to the MCPC dev community at all and you know of any equivalent functionality to safeTeleport in MCPC, I'm happy to look at the docs and consider tying into an API. I was never happy with having to write safeTeleport, I only wrote it because nothing like it exists in Bukkit and I got tired of being stuck in walls in earlier versions of Bukkit. I'd much rather use a server provided safeTeleport mechanism than have to maintain my own; maybe MCPC has this capability?

from homespawnplus.

Watchful1 avatar Watchful1 commented on August 20, 2024

I believe I put the stack trace in that pastebin.

I am not an actual dev for anything, but I am fairly well connected. I do not recall any safeTeleport functions in any forge mods.

I would be happy to help test stuff if it would be useful.

from homespawnplus.

andune avatar andune commented on August 20, 2024

Oh, I totally missed the pastebin link. Thanks, I'll take a look at it and see if it's anything obvious I can fix.

from homespawnplus.

andune avatar andune commented on August 20, 2024

Ah, yes, completely obvious. Whatever mod you are using has block ids > 256. At least up to 1083 according to the stack trace. The safeTeleport algorithm implements an array of blockIds so it's very fast to lookup safe blocks as it iterates through nearby blocks looking for safe spots. That array is only as big as it needs to be (256 for Bukkit).

So it's very easy to fix, I just need to allocate an array up to the maximum blockIds that are possible. Any idea what that number is? I'd find it unlikely you have 1000+ unique blocks so I'd probably just pick 2048, but let me know if you know of blockIds > 2048.

from homespawnplus.

Watchful1 avatar Watchful1 commented on August 20, 2024

Block ID's in forge can go up to 4096.

Thanks for the fix.

from homespawnplus.

andune avatar andune commented on August 20, 2024

Also note this means no custom blocks will ever be considered 'safe', since the safeIds are hardcoded based on Bukkit values. So the custom blocks will always be considered unsafe. I'm not sure what type of blocks these are, but for example if you built a whole house out of them and did a /sethome inside, HSP would not teleport there since they aren't considered safe.

If this is a problem, I can consider some external API that would allow you to tweak safeIds, or maybe even just a config item for HSP so you can add to the list. Also you could always just build your own copy of HSP with your ids hard coded, they are in this file:

https://github.com/andune/HomeSpawnPlus/blob/master/src/main/java/org/morganm/homespawnplus/util/Teleport.java#L83

from homespawnplus.

Watchful1 avatar Watchful1 commented on August 20, 2024

Some mods do add blocks that are safe, such as the liquid one I was testing with, but I'm pretty sure they are nothing you would build a house out of.
Regardless, each mod does things it's own way, so there is no reliable way to tell what is a safe block and what isn't. Additionally, the block ID's are configurable for mods, so it would be impossible to hard code them for a general case like it is with vanilla. As such, a config option might be helpful, but as safeteleport is far from an essential feature of this plugin, and this is very much of an edge case, it would be a very low priority.

Thanks for all the help.

from homespawnplus.

andune avatar andune commented on August 20, 2024

To that point, I don't know if I mentioned it already but you can always just turn safeTeleport off. Just set core.safeTeleport to false.

Or once this 4096 fix is released in a build or dev version you want to use, you can keep it on if you like the core behavior with the mentioned caveat about no safe custom blocks.

from homespawnplus.

andune avatar andune commented on August 20, 2024

FYI the latest builds on Jenkins have this change now, not sure how the CraftBukkit package names match up with what is in Forge, so not sure if that's usable for you or not.

from homespawnplus.

Watchful1 avatar Watchful1 commented on August 20, 2024

once again, thanks for your help.

from homespawnplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.