mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Ensure blocks are not moved below world boundary
This commit is contained in:
parent
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user