Open RyanHecht opened 1 month ago
Would you accept an implementation using e.g. https://github.com/CodeMC/WorldGuardWrapper or prefer to in-house wrap?
TIL WorldGuardWrapper is a thing! I'd certainly accept that, @casptyche!
I have worked on this - https://github.com/MCParks/ShowScript/compare/main...casptyche:ShowScript:worldguard-wrapper
I haven't used Gradle before so I need to self-review my approach in build.gradle, and I haven't tested the changes at all beyond building (which again, not used Gradle, could not even be building it correctly)!
I'm going to do this in my own time, but I thought I'd share the current progress in case this is something quite desired and somebody else may pick it up and finish it off faster than myself.
@RyanHecht
Awesome!
The Gradle part looks correct, implementation
should tell the shadow plugin to shade it in. If I get a moment this weekend I'll try it out and let you know!
Raised PR https://github.com/MCParks/ShowScript/pull/6 - got it building with Gradle myself now, just need to spin up a localhost and test it out on my end
Current WorldGuard 6 syntax:
RegionManager rm = worldGuard.getRegionManager(to.getWorld());
WorldGuard 7:
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionManager regions = container.get(world);
In order to be accepted, the implementation should check for what WorldGuard version is being run (potentially by checking the Minecraft server version as a proxy) and use the proper method for getting the Region Manager