Revert matt's changes

Let's not break Fawe, thanks
This commit is contained in:
N0tMyFaultOG
2020-06-13 18:48:57 +02:00
parent 56f29a3962
commit bfcc6184ad
75 changed files with 687 additions and 980 deletions

View File

@ -1102,7 +1102,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
* @param radius the radius of the spherical area to fill
* @param depth the maximum depth, starting from the origin
* @param direction the direction to fill
* @return the number of blocks affected
* @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int fillDirection(final BlockVector3 origin, final Pattern pattern, final double radius, final int depth, BlockVector3 direction) throws MaxChangedBlocksException {
@ -1181,7 +1181,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
visitor.visit(origin);
// Execute
Operations.completeLegacy(visitor);
Operations.completeBlindly(visitor);
return this.changes = visitor.getAffected();
}
@ -2185,13 +2185,12 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
*
* @param position a position
* @param radius a radius
* @param onlyNormalDirt only affect normal dirt (all default properties)
* @param onlyNormalDirt only affect normal dirt (data value 0)
* @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
@Deprecated
public int green(BlockVector3 position, double radius, boolean onlyNormalDirt)
throws MaxChangedBlocksException {
throws MaxChangedBlocksException {
final double radiusSq = radius * radius;
final int ox = position.getBlockX();
@ -2258,7 +2257,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), generator);
LayerVisitor visitor = new LayerVisitor(region, minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
Operations.completeLegacy(visitor);
Operations.completeBlindly(visitor);
return this.changes = ground.getAffected();
}
@ -2404,42 +2403,11 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
return changed;
}
/**
* Deforms the region by a given expression. A deform provides a block's x, y, and z coordinates (possibly scaled)
* to an expression, and then sets the block to the block given by the resulting values of the variables, if they
* have changed.
*
* @param region the region to deform
* @param zero the origin of the coordinate system
* @param unit the scale of the coordinate system
* @param expressionString the expression to evaluate for each block
*
* @return number of blocks changed
*
* @throws ExpressionException thrown on invalid expression input
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int deformRegion(final Region region, final Vector3 zero, final Vector3 unit, final String expressionString)
throws ExpressionException, MaxChangedBlocksException {
return deformRegion(region, zero, unit, expressionString, WorldEdit.getInstance().getConfiguration().calculationTimeout);
}
/**
* Deforms the region by a given expression. A deform provides a block's x, y, and z coordinates (possibly scaled)
* to an expression, and then sets the block to the block given by the resulting values of the variables, if they
* have changed.
*
* @param region the region to deform
* @param zero the origin of the coordinate system
* @param unit the scale of the coordinate system
* @param expressionString the expression to evaluate for each block
* @param timeout maximum time for the expression to evaluate for each block. -1 for unlimited.
*
* @return number of blocks changed
*
* @throws ExpressionException thrown on invalid expression input
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int deformRegion(final Region region, final Vector3 zero, final Vector3 unit, final String expressionString,
final int timeout) throws ExpressionException, MaxChangedBlocksException {
final Expression expression = Expression.compile(expressionString, "x", "y", "z");
@ -2457,6 +2425,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
final Vector3 zero2 = zero.add(0.5, 0.5, 0.5);
RegionVisitor visitor = new RegionVisitor(region, new RegionFunction() {
private final MutableBlockVector3 mutable = new MutableBlockVector3();
@Override
public boolean apply(BlockVector3 position) throws WorldEditException {