EngineHub / EngineHub/WorldEdit

pos1/2 commands do not clamp to world bounds

Open
#1,270 2 comments 0 reactions 0 assignees View on GitHub
status:accepted type:bug
Dominant language
Java
Stars
3.5k
Forks
960
Avg merge
6h 57m
Merged PRs (30d)
1

Description

**Describe the bug**

Using the commands `//pos1` and `//pos2` while outside world bounds (<0, >255) will set the pos to that y value.

**To Reproduce**

1. a. Fly up to y=256 or go below y=0 and use `//pos1` and `//pos2`
1. b. Alternative: Run `//pos1 0,-10,0` and `//pos2 0,260,0`. Run `//expand 1 u` and observe the negative expand due to clamped region size.

**Expected behavior**

Expect the selection to get clamped to world bounds, such as what happens when using other selection commands like //expand, //shift. Alternative would be erroring instead.

**Screenshots**

![](https://i.imgur.com/nqAL56g.png)

**Additional context**

DataValidatorExtent ensures that gets/sets to the selection return air/noop. This does allow some interesting things like WG regions that are below bedrock etc. though. Unsure if that's problematic for anything. This is mostly just to be consistent with selection modification commands. Possibly a toggle/option of some sort could be added to allow out-of-bounds selections more generally?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.