PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

Freshly create plot schematic is regenerated (cleared) one block too low

Open PierreSchwang opened this issue 1 year ago • 4 comments

Server Implementation

Paper

Server Version

1.20.4

Describe the bug

When clearing a plot in an area utilizing plot schematics, the schematic will be pasted one block too low. World-Generation itself works (e.g. //regen works).

The culprit seems to be somewhere here (used by the FAWE Delegate to determine minY for plot schematics): https://github.com/IntellectualSites/PlotSquared/blob/a6412581a6bef54b816c078c690e6815495377dd/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java#L558-L560

When replacing SCHEM_Y + plotY with getMinBuildHeight() (the same reference point the world generator uses, as visible in HybridGen: https://github.com/IntellectualSites/PlotSquared/blob/main/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java#L76) clear works. My only idea for that being is, that one of these two variables is normalized somewhere - possibly against the road height. I don't just want to PR my fix, as I'm not sure what the reasoning behind the change was (@dordsor21 ?) and if that does not have any unexpected side effects.

To Reproduce

  1. Create plot schematic as described in wiki (/plot schematic save, move to appropriate schematic folder)
  2. World will be generated accordingly
  3. Claim Plot and run /plot clear
  4. Schematic will be one block too low

Expected behaviour

The schematic should be pasted from the correct y-level

Screenshots / Videos

No response

Error log (if applicable)

No response

Fawe Debugpaste

Fawe Version

Checklist

  • [X] I have included a Fawe debugpaste.
  • [X] I am using the newest build from https://ci.athion.net/job/FastAsyncWorldEdit/ and the issue still persists.

Anything else?

No response

PierreSchwang avatar Apr 19 '24 19:04 PierreSchwang

I can replicate this.

grafik

schematics:
  # Whether schematic based generation should paste schematic on top of plots, or from Y=1
  paste-on-top: true
  # Whether schematic based road generation should paste schematic on top of roads, or from Y=1
  paste-road-on-top: true
  # If schematics that do not match a plot's size should be pasted anyway
  #  - This will still only paste a schematic with a plot's bounds.
  #  - If a schematic is too big, it will cut off, and if too small, will not full the plot.
  paste-mismatches: true
  # If the wall height should be taken into account when calculating the road schematic paste height
  #  - If true, will use the lower of wall and road height.
  #  - If true, will ensure correct schematic behaviour (no parts are cut off).
  #  - Set to false if you experience the road being set one block too low
  #    (only for road schematics created pre 6.1.4).
  use-wall-in-road-schem-height: true

RedstoneFuture avatar Oct 27 '24 01:10 RedstoneFuture

@dordsor21 Are you involved in the logic of the paste algorithm?

The fix looks simple, but I don't want to just increment any value. ^^

RedstoneFuture avatar Oct 27 '24 01:10 RedstoneFuture

I have the same problem! Is there a solution for this?

LindAn79 avatar Nov 14 '24 20:11 LindAn79

i have the same problem but only when i merge it and delete it. image

Sytrexofficial avatar Dec 29 '24 04:12 Sytrexofficial