MCParks / ShowScript

A Spigot plugin and programming language to schedule and program commands to be run at specified timecodes
GNU Affero General Public License v3.0
4 stars 1 forks source link

Simltaneously support WorldGuard 7 by wrapping how we get the `RegionManager` #5

Open RyanHecht opened 1 month ago

RyanHecht commented 1 month ago

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

casptyche commented 1 week ago

Would you accept an implementation using e.g. https://github.com/CodeMC/WorldGuardWrapper or prefer to in-house wrap?

RyanHecht commented 1 week ago

TIL WorldGuardWrapper is a thing! I'd certainly accept that, @casptyche!

casptyche commented 1 week ago

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

RyanHecht commented 1 week ago

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!

casptyche commented 23 hours ago

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