-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorldGuard compatibility #124
base: master
Are you sure you want to change the base?
Conversation
Might want to check this post - as far as I know, with how you're doing things right now, if WG is not installed you'll get |
TL;DR, |
Hi! In my implementation I use
This way I never load class related to WG until next steps which ensures that WorldGuard is loaded. The problem you are talking about isn't going to happen because it will never go beyond that point. Java loads classes when necessary that's why it works. Tested and it works without WG (without errors in console). Even though if you want I can rewrite it to other class |
Alright, if you're sure it works that's fine. |
Sure! Definetly it will add more flexibilty for users. Also what do you think about resigning from forcing portal placement if no space was found? |
Hmm, I'll think about that. Performance is another thing that will need to be thought about - BP can check many thousands of portal positions on each spawn, especially with the new world height limit. |
Ok, I've added requested stuff. I've also made some performance tests and sadly when there is no space for portal check is running for about 10 sec on 5600X. I know that it's done off thread so world lives, but one core is sucked out of it all juice. tldr If portal is being ignited and there is big region which blocks it BetterPortals will use all out of one core |
Came up with idea of "optimization". BetterPortals will find candidate for portal position quickly at border of that WG region. To prevent unnecessary work from BP I'm gonna block portal ignition for scaled region (1/8x and 8x etc.). This way BP won't start search if portal is ignited in center of WG region |
This PR adds compatibility with WorldGuard plugin.
When BetterPortals tries to create new portal using NewPortalChecker it checks for WG plugin and if it is enabled checks if player can build in desired location. If somehow player would not be provided default logic of WG is used