Fix erosion and pull brushes

Fixes #559
This commit is contained in:
IronApollo 2020-09-08 19:17:28 -04:00 committed by Aurora
parent a8f53d6414
commit 1fa0777d3b
3 changed files with 9 additions and 9 deletions

View File

@ -91,7 +91,7 @@ public class ErodeBrush implements Brush {
int x2y2 = x2 + z * z;
for (int y = -brushSize, rely = 0; y <= brushSize; y++, rely++) {
int cube = x2y2 + y * y;
target.setBlock(x, y, z, current.getBlock(relx, rely, relz));
target.setBlock(relx, rely, relz, current.getBlock(relx, rely, relz));
if (cube >= brushSizeSquared) {
continue;
}
@ -136,7 +136,7 @@ public class ErodeBrush implements Brush {
int x2y2 = x2 + z * z;
for (int y = -brushSize, rely = 0; y <= brushSize; y++, rely++) {
int cube = x2y2 + y * y;
target.setBlock(x, y, z, current.getBlock(relx, rely, relz));
target.setBlock(relx, rely, relz, current.getBlock(relx, rely, relz));
if (cube >= brushSizeSquared) {
continue;
}

View File

@ -5,6 +5,6 @@ public class RaiseBrush extends ErodeBrush {
this(6, 0, 1, 1);
}
public RaiseBrush(int erodeFaces, int erodeRec, int fillFaces, int fillRec) {
super(2, 1, 5, 1);
super(erodeFaces, erodeRec, fillFaces, fillRec);
}
}

View File

@ -182,9 +182,9 @@ public class BrushCommands {
public void erodeBrush(InjectedValueAccess context, @Arg(desc = "The radius for eroding",
def = "5") Expression radius,
@Arg(desc = "erodeFaces",
def = "6") int erodefaces, @Arg(desc = "erodeRec",
def = "0") int erodeRec, @Arg(desc = "fillFaces",
def = "1") int fillFaces,
def = "2") int erodefaces, @Arg(desc = "erodeRec",
def = "1") int erodeRec, @Arg(desc = "fillFaces",
def = "5") int fillFaces,
@Arg(desc = "fillRec",
def = "1") int fillRec) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
@ -197,10 +197,10 @@ public class BrushCommands {
public void pullBrush(InjectedValueAccess context,
@Arg(desc = "The radius to sample for blending",
def = "5") Expression radius, @Arg(desc = "erodeFaces",
def = "2") int erodefaces, @Arg(desc = "erodeRec",
def = "1")
def = "6") int erodefaces, @Arg(desc = "erodeRec",
def = "0")
int erodeRec, @Arg(desc = "fillFaces",
def = "5") int fillFaces, @Arg(desc = "fillRec",
def = "1") int fillFaces, @Arg(desc = "fillRec",
def = "1") int fillRec)
throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);