upstream: Update upstream (#1430)

* upstream: Update upstream

c407471 Re-add class shutter with tweaks. (1947)

* upstream: Update Upstream

29f1c66 If a trace hits the world limit, cancel it (1942)

* upstream: Update upstream

511daa5 Update paperweight dev bundle
This commit is contained in:
Alex
2021-11-26 23:31:27 +01:00
committed by GitHub
parent bd9e237376
commit 11e25911d5
4 changed files with 40 additions and 7 deletions

View File

@ -170,17 +170,15 @@ public class TargetBlock {
* @return Block
*/
public Location getAnyTargetBlock() {
boolean searchForLastBlock = true;
Location lastBlock = null;
while (getNextBlock() != null) {
if (stopMask.test(targetPos)) {
break;
} else {
if (searchForLastBlock) {
lastBlock = getCurrentBlock();
if (lastBlock.getBlockY() <= world.getMinY() || lastBlock.getBlockY() >= world.getMaxY()) {
searchForLastBlock = false;
}
lastBlock = getCurrentBlock();
if (lastBlock.getBlockY() < world.getMinY()
|| lastBlock.getBlockY() > world.getMaxY()) {
return null;
}
}
}