Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 19:02:36 +01:00
Ensure blocks are not moved below world boundary
Dieser Commit ist enthalten in:
Ursprung
2ee71cc72f
Commit
e87a5559d6
@ -42,6 +42,7 @@ public class GravityBrush implements Brush {
|
|||||||
@Override
|
@Override
|
||||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||||
double yMax = fullHeight ? editSession.getWorld().getMaxY() : position.getY() + size;
|
double yMax = fullHeight ? editSession.getWorld().getMaxY() : position.getY() + size;
|
||||||
|
double yMin = Math.max(position.getY() - size, 0);
|
||||||
LocatedBlockList column = new LocatedBlockList();
|
LocatedBlockList column = new LocatedBlockList();
|
||||||
Set<BlockVector3> removedBlocks = new LinkedHashSet<>();
|
Set<BlockVector3> removedBlocks = new LinkedHashSet<>();
|
||||||
for (double x = position.getX() - size; x <= position.getX() + size; x++) {
|
for (double x = position.getX() - size; x <= position.getX() + size; x++) {
|
||||||
@ -55,7 +56,7 @@ public class GravityBrush implements Brush {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
BlockVector3 lowestAir = null;
|
BlockVector3 lowestAir = null;
|
||||||
for (double y = position.getY() - size; y <= yMax; y++) {
|
for (double y = yMin; y <= yMax; y++) {
|
||||||
BlockVector3 pt = BlockVector3.at(x, y, z);
|
BlockVector3 pt = BlockVector3.at(x, y, z);
|
||||||
|
|
||||||
BaseBlock block = editSession.getFullBlock(pt);
|
BaseBlock block = editSession.getFullBlock(pt);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren