Implement resize transformed region #1421
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resized regions
Resized regions take in another region and resize it by a certain amount. I think the best way to visualize this is with an example:
This will fill an area 5 blocks sideways, 6 down and 4 up with glass, then will fill a region that expands by 100% of the original size to each direction with orange glass, and finally places back the obsidian.
Result is as follows:
Attributes
min
How much to expand in the -x, -y and -z directionsmax
How much to expand in the +x, +y and +z directionsrelative
If the min&max should be relative to the original size of the region (proportion) or absolute (number of blocks)false
(default): min & max are a number of blocks to expand in each directiontrue
: min & max represent a multiplier of the original size, eg: 2 = means 200% in each directionrelative="true" min="0.5,0.5,0.5" max="0.5,0.5,0.5"
region
Can be an attribute, or be a direct child.Relative resize
Expand the region by a factor of 100% in each direction (notice: relative="true"), so because the original is 2 tall, and 1 wide, it expands 2 up/down, and 1 to each side.
Absolute resize
Expand the region by an absolute 5 blocks sideways, 6 down, 4 up:
Caution with unions
BE AWARE: Multiple children will act as a union. You probably do not want to use this region type with unions, as it will likely not create the effect you desire!!
What happens with a union:
Relative result:
The union is like 34 blocks across, so the relative resize by an extra factor of 100% in each direction, it triples the size and the result of the resize is a region 102 blocks wide (orange glass).
Absolute result:
The absolute region ends up looking pretty broken, because it's "only" enlarging by 5 blocks a region that is over 30 blocks across, meaning its a very small % increase, and barely creates extra area.
So the region did in fact grow by 4 blocks up and 5 sideways, and the area of the monument (the two blocks) enlarge to this 2x4 glass column:
Other changes/fixes
The PR includes a couple minor fixes too: