OperationHelper -> Operations

Dieser Commit ist enthalten in:
sk89q 2014-04-01 16:21:27 -07:00
Ursprung 2d67ae9e65
Commit 1667fa5c79
3 geänderte Dateien mit 19 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -574,7 +574,7 @@ public class EditSession implements Extent {
public void undo(EditSession editSession) { public void undo(EditSession editSession) {
UndoContext context = new UndoContext(); UndoContext context = new UndoContext();
context.setExtent(editSession.bypassHistory); context.setExtent(editSession.bypassHistory);
OperationHelper.completeBlindly(ChangeSetExecutor.createUndo(changeSet, context)); Operations.completeBlindly(ChangeSetExecutor.createUndo(changeSet, context));
editSession.flushQueue(); editSession.flushQueue();
} }
@ -586,7 +586,7 @@ public class EditSession implements Extent {
public void redo(EditSession editSession) { public void redo(EditSession editSession) {
UndoContext context = new UndoContext(); UndoContext context = new UndoContext();
context.setExtent(editSession.bypassHistory); context.setExtent(editSession.bypassHistory);
OperationHelper.completeBlindly(ChangeSetExecutor.createRedo(changeSet, context)); Operations.completeBlindly(ChangeSetExecutor.createRedo(changeSet, context));
editSession.flushQueue(); editSession.flushQueue();
} }
@ -603,7 +603,7 @@ public class EditSession implements Extent {
* Finish off the queue. * Finish off the queue.
*/ */
public void flushQueue() { public void flushQueue() {
OperationHelper.completeBlindly(commit()); Operations.completeBlindly(commit());
} }
@Override @Override
@ -631,7 +631,7 @@ public class EditSession implements Extent {
Counter count = new Counter(); Counter count = new Counter();
RegionMaskingFilter filter = new RegionMaskingFilter(mask, count); RegionMaskingFilter filter = new RegionMaskingFilter(mask, count);
RegionVisitor visitor = new RegionVisitor(region, filter); RegionVisitor visitor = new RegionVisitor(region, filter);
OperationHelper.completeBlindly(visitor); // We can't throw exceptions, nor do we expect any Operations.completeBlindly(visitor); // We can't throw exceptions, nor do we expect any
return count.getCount(); return count.getCount();
} }
@ -692,7 +692,7 @@ public class EditSession implements Extent {
visitor.visit(origin); visitor.visit(origin);
// Execute // Execute
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return visitor.getAffected(); return visitor.getAffected();
} }
@ -795,7 +795,7 @@ public class EditSession implements Extent {
BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern));
RegionVisitor visitor = new RegionVisitor(region, replace); RegionVisitor visitor = new RegionVisitor(region, replace);
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return visitor.getAffected(); return visitor.getAffected();
} }
@ -849,7 +849,7 @@ public class EditSession implements Extent {
BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern));
RegionMaskingFilter filter = new RegionMaskingFilter(Masks.wrap(this, mask), replace); RegionMaskingFilter filter = new RegionMaskingFilter(Masks.wrap(this, mask), replace);
RegionVisitor visitor = new RegionVisitor(region, filter); RegionVisitor visitor = new RegionVisitor(region, filter);
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return visitor.getAffected(); return visitor.getAffected();
} }
@ -1032,7 +1032,7 @@ public class EditSession implements Extent {
RegionOffset offset = new RegionOffset(new Vector(0, 1, 0), replace); RegionOffset offset = new RegionOffset(new Vector(0, 1, 0), replace);
GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), offset); GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), offset);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return ground.getAffected(); return ground.getAffected();
} }
@ -1050,7 +1050,7 @@ public class EditSession implements Extent {
Naturalizer naturalizer = new Naturalizer(this); Naturalizer naturalizer = new Naturalizer(this);
FlatRegion flatRegion = Regions.asFlatRegion(region); FlatRegion flatRegion = Regions.asFlatRegion(region);
LayerVisitor visitor = new LayerVisitor(flatRegion, minimumBlockY(region), maximumBlockY(region), naturalizer); LayerVisitor visitor = new LayerVisitor(flatRegion, minimumBlockY(region), maximumBlockY(region), naturalizer);
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return naturalizer.getAffected(); return naturalizer.getAffected();
} }
@ -1077,7 +1077,7 @@ public class EditSession implements Extent {
if (!copyAir) { if (!copyAir) {
copy.setSourceMask(new ExistingBlockMask(this)); copy.setSourceMask(new ExistingBlockMask(this));
} }
OperationHelper.completeLegacy(copy); Operations.completeLegacy(copy);
return copy.getAffected(); return copy.getAffected();
} }
@ -1119,7 +1119,7 @@ public class EditSession implements Extent {
RegionVisitor visitor = new RegionVisitor(buffer.asRegion(), replace); RegionVisitor visitor = new RegionVisitor(buffer.asRegion(), replace);
OperationQueue operation = new OperationQueue(copy, visitor); OperationQueue operation = new OperationQueue(copy, visitor);
OperationHelper.completeLegacy(operation); Operations.completeLegacy(operation);
return copy.getAffected(); return copy.getAffected();
} }
@ -1166,7 +1166,7 @@ public class EditSession implements Extent {
} }
} }
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return visitor.getAffected(); return visitor.getAffected();
} }
@ -1214,7 +1214,7 @@ public class EditSession implements Extent {
} }
} }
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return visitor.getAffected(); return visitor.getAffected();
} }
@ -1684,7 +1684,7 @@ public class EditSession implements Extent {
GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), generator); GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), generator);
LayerVisitor visitor = new LayerVisitor(region, minimumBlockY(region), maximumBlockY(region), ground); LayerVisitor visitor = new LayerVisitor(region, minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
return ground.getAffected(); return ground.getAffected();
} }

Datei anzeigen

@ -28,13 +28,13 @@ import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.expression.ExpressionException; import com.sk89q.worldedit.expression.ExpressionException;
import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.ExistingBlockMask;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.math.convolution.GaussianKernel; import com.sk89q.worldedit.math.convolution.GaussianKernel;
import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.math.convolution.HeightMap;
import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.math.convolution.HeightMapFilter;
import com.sk89q.worldedit.function.GroundFunction; import com.sk89q.worldedit.function.GroundFunction;
import com.sk89q.worldedit.function.generator.FloraGenerator; import com.sk89q.worldedit.function.generator.FloraGenerator;
import com.sk89q.worldedit.function.generator.ForestGenerator; import com.sk89q.worldedit.function.generator.ForestGenerator;
import com.sk89q.worldedit.function.operation.OperationHelper;
import com.sk89q.worldedit.function.visitor.LayerVisitor; import com.sk89q.worldedit.function.visitor.LayerVisitor;
import com.sk89q.worldedit.masks.Mask; import com.sk89q.worldedit.masks.Mask;
import com.sk89q.worldedit.function.mask.NoiseFilter2D; import com.sk89q.worldedit.function.mask.NoiseFilter2D;
@ -555,7 +555,7 @@ public class RegionCommands {
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
player.print(ground.getAffected() + " trees created."); player.print(ground.getAffected() + " trees created.");
} }
@ -577,7 +577,7 @@ public class RegionCommands {
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
OperationHelper.completeLegacy(visitor); Operations.completeLegacy(visitor);
player.print(ground.getAffected() + " flora created."); player.print(ground.getAffected() + " flora created.");
} }

Datei anzeigen

@ -25,9 +25,9 @@ import com.sk89q.worldedit.WorldEditException;
/** /**
* Operation helper methods. * Operation helper methods.
*/ */
public final class OperationHelper { public final class Operations {
private OperationHelper() { private Operations() {
} }
/** /**