MCTowns

MCTowns

52.4k Downloads

Territories bought using //sel poly WorldEdit selection are not made in XY blocks.

apengstrom opened this issue ยท 14 comments

commented

So, this is fairly complicated. I use //sel poly to use WorldEdit's polygon selector, and I lay out a broad range of points to make up a massive territory for a town. I've done this many times and it works just fine, albeit one issue remains. It does not purchase the territory as XY blocks (in other words, when my lowest point is at Y 50 and my highest point is at Y 100 for my polygon selection, and I create the territory, the territory's WorldGuard region is limited in height.

Now, I've had some issues with WorldEdit. I think that if I create a polygon, and I //expand up, //expand down, or //expand vert it turns it into a cuboid made up of edges from the furthest points, east west and north. I had created a large polygon region once and when I expanded it, it turned into an even larger rectangular cuboid.

We need some way to be able to select a polygon, and then when we create the territory it does it with max height (entire XY block) like it's supposed to. However, I'm not sure if this is a WorldEdit issue as opposed to MCTowns. Perhaps you could bring some insight to this, and if needed, I can create the appropriate ticket for the WorldEdit project?

Thanks.. and I will get back to you on that other ticket soon.

commented

I think you mean "XZ" blocks? Y is the height coordinate.

Anyhow, I can definitely put in some sort of switch (-e?) to make it auto expand-vert.

However, the way you described it should work. In my experience, using //expand vert with a poly region behaved how you would expect it to- the poly region stayed a poly region with the same vertices that you set, but it expanded from y=0 to y=max. The last time I was messing around with poly regions, I was using a client-side mod called WorldEditCUI which displayed my selection superimposed over the 3D game world (super nifty). When I used //expand vert, it looked like it was working correctly. You might try checking out WECUI, though I think it may be out of date/abandoned at this point, I'm not sure.

If you want to verify this isn't something MCTowns is doing wrong, try manually making a WG region with the WE method you described and see if that comes out correctly.

I'll mess around with this on my own using the latest versions of WG and WE later.

And just for the record, MCTowns WG regions aren't anything special from normal WG regions, and MCTowns is (for the most part) creating them in the same way "/region define" creates them.

commented

Ok. I just tested this again today as we created a new town. There is an issue going on. Here's the process flow, as well as an image of the town that was created using dynmap world guard integration.

  1. Create a town.
  2. //sel poly, left click for position one and right clicked all the points which went around all the buildings, etc. Definitely not a square or rectangle.
  3. //expand vert
  4. //town add territory main, territory was created.
  5. Waited for dynmap to update and I received the image attached below. The region is completely rectangular.

screen shot 2014-01-07 at 10 45 37 pm

commented

I've followed your reproduction steps exactly under these conditions:

The result was the following image:
2014-01-08_01 04 00

  • purple is what's supposed to be the region (I actually generated it with //set purple after I made my WE selection and before making the territory)
  • green spots were where I tested with leather and they were in the territory
  • red spots were where I tested with leather and they were not in the territory.

So, everything seems to check out as far as WE, WG and MCTowns go. I suspect the issue is with dynmap.

Can you try using raw WG regions and see if the issue with Dynmap persists?

i.e.

  1. //sel poly
  2. make selection
  3. /region define testreg
  4. wait for dynmap to update

Also, can you check with leather and see what shape your regions are as reported by WG (not dynmap)?

commented

Oh, I also checked the code that would determine if the region created was a polygon or a cuboid:

https://github.com/jmhertlein/MCTowns/blob/dev/src/main/java/net/jmhertlein/mctowns/command/handlers/CommandHandler.java#L254

And everything there checks out (and hasn't changed for quite some time).

commented

Here are some images of what I did this morning. I followed your instructions. The first image showed the town territory's region info after making it with //sel poly. Its showing as a cuboid for some reason. This was made with mct commands, not world guard.

screen shot 2014-01-08 at 8 39 56 am

The second image shows me creating a region strictly with WorldGuard, and the third shows that it actually created a proper Poly selection.

screen shot 2014-01-08 at 8 45 21 am
screen shot 2014-01-08 at 9 14 26 am

After //expand vert, the region is still poly. It seems whenever I do this with //town add territory [name] it creates it as a cuboid. Not sure why.

commented

Here is my setup:
[08:35:17] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.5.9-SNAPSHOT:2971-85035a2,master
[08:35:17] [Server thread/INFO]: [WorldGuard] Loading WorldGuard v5.8.1-SNAPSHOT:1264-ffda88f,master
[08:35:17] [Server thread/INFO]: [MCTowns] Loading MCTowns v2.4.0-SNAPSHOT

commented

I've just tried a bunch of other things:

  • Poly regions with 20+ points (WE used to have problems with 20+ points a long time ago)
  • turning on the economy and buying the territories (shouldn't be different than using -admin, but checked anyway)

I still can't seem to reproduce your issue. I do see, though, that you're using snapshot builds of both WE and WG.

Could you try this for me:

  1. Make a brand new server
  2. Install this MCTowns build
  3. Install this WE build and this WG build
  4. Try reproducing your issue

Additionally, if you feel safe doing so, downgrade back to the last stable releases of WE and WG (the links above) and see if the issue persists.

commented

It's something wrong with one of two things. Either the WorldGuard or WorldEdit plugins, or how you're hooking into them. (and if you're just using the world guard and world edit commands to make this work, its likely them.) See image attached. Small region was made with MCTowns commands as a territory for the town that owns the large territory above it.

I just downgraded the WE build and WG build, and it works. I did not touch the MCTowns build.

My only worry is that those WE and WG builds from my understanding are not fully compatible with 1.7.x. We may have to put up with one or the other of these issues, for right now...

screen shot 2014-01-08 at 10 00 09 pm

commented

If it works on the stable WG version, and not on the snapshot, I'd say that the issue is probably a WG one, for now. I'll stick some debug output in and see what it spits out on the WG snapshot.

commented

Hey. I just tested something. It's not the WG or WE at all. It's when you redefine a territory. Anytime I redefine a territory, even if its a poly selection, it turns it into a cuboid. This is why through our tests it was hard to debug. We were probably creating territories fresh.

I created a territory using poly selection, it worked fine. This is with the snapshots of all three plugins, the ones I used that failed last time. When I tried to redefine it, that's when things went haywire.

screen shot 2014-01-18 at 1 04 48 am

commented

Oh my, that would make a difference. Let me look.

Ahh yep

nuWGRegion = new ProtectedCuboidRegion(oldWGReg.getId(),
            nuRegionBounds.getNativeMaximumPoint().toBlockVector(),
            nuRegionBounds.getNativeMinimumPoint().toBlockVector());

I must've missed this when I added support for polygon regions.

commented

Nice! Glad we found it :) I was confused for a while as to what was causing it to happen, then I realized it was only when I redefined. lol.

commented

Fixed in 7b941e7.

commented

Confirming this is fixed.