Don't cache location for circle brush, fix #970

Also, allow filled circles (very cool feature)
This commit is contained in:
Hannes Greule
2021-04-10 01:07:51 +02:00
parent 911d3a00eb
commit 19592df1f6
3 changed files with 16 additions and 9 deletions

View File

@ -1985,8 +1985,6 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
double threshold = 0.5;
LocalBlockVectorSet set = new LocalBlockVectorSet();
double nextXn = 0;
double dx;
double dy;

View File

@ -221,13 +221,16 @@ public class BrushCommands {
desc = "Creates a circle, which revolves around your facing direction"
)
@CommandPermissions("worldedit.brush.sphere")
public void circleBrush(Player player, InjectedValueAccess context,
public void circleBrush(InjectedValueAccess context,
@Arg(desc = "Pattern")
Pattern fill,
@Arg(desc = "The radius to sample for blending", def = "5")
Expression radius) throws WorldEditException {
Expression radius,
@Arg(name = "filled", desc = "Whether the circle should be filled", def = "false")
boolean filled
) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
set(context, new CircleBrush(player)).setSize(radius).setFill(fill);
set(context, new CircleBrush(filled)).setSize(radius).setFill(fill);
}
@Command(