Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-27 03:12:37 +01:00
Don't cache location for circle brush, fix #970
Also, allow filled circles (very cool feature)
Dieser Commit ist enthalten in:
Ursprung
911d3a00eb
Commit
19592df1f6
@ -10,16 +10,22 @@ import com.sk89q.worldedit.math.Vector3;
|
|||||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||||
|
|
||||||
public class CircleBrush implements Brush {
|
public class CircleBrush implements Brush {
|
||||||
private final Player player;
|
|
||||||
|
|
||||||
public CircleBrush(Player player) {
|
private final boolean filled;
|
||||||
this.player = player;
|
|
||||||
|
public CircleBrush(boolean filled) {
|
||||||
|
|
||||||
|
this.filled = filled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 {
|
||||||
|
Player player = editSession.getPlayer();
|
||||||
|
if (player == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Vector3 normal = position.toVector3().subtract(player.getLocation());
|
Vector3 normal = position.toVector3().subtract(player.getLocation());
|
||||||
editSession.makeCircle(position, pattern, size, size, size, false, normal);
|
editSession.makeCircle(position, pattern, size, size, size, filled, normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3 any90Rotate(Vector3 normal) {
|
private Vector3 any90Rotate(Vector3 normal) {
|
||||||
|
@ -1985,8 +1985,6 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
|||||||
|
|
||||||
double threshold = 0.5;
|
double threshold = 0.5;
|
||||||
|
|
||||||
LocalBlockVectorSet set = new LocalBlockVectorSet();
|
|
||||||
|
|
||||||
double nextXn = 0;
|
double nextXn = 0;
|
||||||
double dx;
|
double dx;
|
||||||
double dy;
|
double dy;
|
||||||
|
@ -221,13 +221,16 @@ public class BrushCommands {
|
|||||||
desc = "Creates a circle, which revolves around your facing direction"
|
desc = "Creates a circle, which revolves around your facing direction"
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.brush.sphere")
|
@CommandPermissions("worldedit.brush.sphere")
|
||||||
public void circleBrush(Player player, InjectedValueAccess context,
|
public void circleBrush(InjectedValueAccess context,
|
||||||
@Arg(desc = "Pattern")
|
@Arg(desc = "Pattern")
|
||||||
Pattern fill,
|
Pattern fill,
|
||||||
@Arg(desc = "The radius to sample for blending", def = "5")
|
@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);
|
worldEdit.checkMaxBrushRadius(radius);
|
||||||
set(context, new CircleBrush(player)).setSize(radius).setFill(fill);
|
set(context, new CircleBrush(filled)).setSize(radius).setFill(fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren