mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-17 14:03:55 +00:00
Added library support for non-integer radius spheres and cylinders.
This commit is contained in:
@ -41,7 +41,7 @@ public class BrushTool implements TraceTool {
|
||||
private Mask mask = null;
|
||||
private Brush brush = new SphereBrush();
|
||||
private Pattern material = new SingleBlockPattern(new BaseBlock(BlockID.COBBLESTONE));
|
||||
private int size = 1;
|
||||
private double size = 1;
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
@ -125,17 +125,17 @@ public class BrushTool implements TraceTool {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getSize() {
|
||||
public double getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the set brush size.
|
||||
*
|
||||
* @param size
|
||||
* @param radius
|
||||
*/
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
public void setSize(double radius) {
|
||||
this.size = radius;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,6 +39,6 @@ public interface Brush {
|
||||
* @param size
|
||||
* @throws MaxChangedBlocksException
|
||||
*/
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class ClipboardBrush implements Brush {
|
||||
this.noAir = noAir;
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
clipboard.place(editSession,
|
||||
pos.subtract(clipboard.getSize().divide(2)), noAir);
|
||||
|
@ -31,7 +31,7 @@ public class CylinderBrush implements Brush {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
editSession.makeCylinder(pos, mat, size, height);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class HollowCylinderBrush implements Brush {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
editSession.makeHollowCylinder(pos, mat, size, height);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class HollowSphereBrush implements Brush {
|
||||
public HollowSphereBrush() {
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
editSession.makeSphere(pos, mat, size, false);
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ public class SmoothBrush implements Brush {
|
||||
this.iterations = iterations;
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
int rad = size;
|
||||
double rad = size;
|
||||
Vector min = pos.subtract(rad, rad, rad);
|
||||
Vector max = pos.add(rad, rad + 10, rad);
|
||||
Region region = new CuboidRegion(min, max);
|
||||
|
@ -28,7 +28,7 @@ public class SphereBrush implements Brush {
|
||||
public SphereBrush() {
|
||||
}
|
||||
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, int size)
|
||||
public void build(EditSession editSession, Vector pos, Pattern mat, double size)
|
||||
throws MaxChangedBlocksException {
|
||||
editSession.makeSphere(pos, mat, size, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user