From 1667fa5c7902d390d96c9afa55b2fad769f32a5b Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 1 Apr 2014 16:21:27 -0700 Subject: [PATCH] OperationHelper -> Operations --- .../java/com/sk89q/worldedit/EditSession.java | 28 +++++++++---------- .../worldedit/commands/RegionCommands.java | 6 ++-- .../{OperationHelper.java => Operations.java} | 4 +-- 3 files changed, 19 insertions(+), 19 deletions(-) rename src/main/java/com/sk89q/worldedit/function/operation/{OperationHelper.java => Operations.java} (97%) diff --git a/src/main/java/com/sk89q/worldedit/EditSession.java b/src/main/java/com/sk89q/worldedit/EditSession.java index abcd9e3a1..ff56140b4 100644 --- a/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/src/main/java/com/sk89q/worldedit/EditSession.java @@ -574,7 +574,7 @@ public class EditSession implements Extent { public void undo(EditSession editSession) { UndoContext context = new UndoContext(); context.setExtent(editSession.bypassHistory); - OperationHelper.completeBlindly(ChangeSetExecutor.createUndo(changeSet, context)); + Operations.completeBlindly(ChangeSetExecutor.createUndo(changeSet, context)); editSession.flushQueue(); } @@ -586,7 +586,7 @@ public class EditSession implements Extent { public void redo(EditSession editSession) { UndoContext context = new UndoContext(); context.setExtent(editSession.bypassHistory); - OperationHelper.completeBlindly(ChangeSetExecutor.createRedo(changeSet, context)); + Operations.completeBlindly(ChangeSetExecutor.createRedo(changeSet, context)); editSession.flushQueue(); } @@ -603,7 +603,7 @@ public class EditSession implements Extent { * Finish off the queue. */ public void flushQueue() { - OperationHelper.completeBlindly(commit()); + Operations.completeBlindly(commit()); } @Override @@ -631,7 +631,7 @@ public class EditSession implements Extent { Counter count = new Counter(); RegionMaskingFilter filter = new RegionMaskingFilter(mask, count); 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(); } @@ -692,7 +692,7 @@ public class EditSession implements Extent { visitor.visit(origin); // Execute - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return visitor.getAffected(); } @@ -795,7 +795,7 @@ public class EditSession implements Extent { BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); RegionVisitor visitor = new RegionVisitor(region, replace); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return visitor.getAffected(); } @@ -849,7 +849,7 @@ public class EditSession implements Extent { BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); RegionMaskingFilter filter = new RegionMaskingFilter(Masks.wrap(this, mask), replace); RegionVisitor visitor = new RegionVisitor(region, filter); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return visitor.getAffected(); } @@ -1032,7 +1032,7 @@ public class EditSession implements Extent { RegionOffset offset = new RegionOffset(new Vector(0, 1, 0), replace); GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), offset); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return ground.getAffected(); } @@ -1050,7 +1050,7 @@ public class EditSession implements Extent { Naturalizer naturalizer = new Naturalizer(this); FlatRegion flatRegion = Regions.asFlatRegion(region); LayerVisitor visitor = new LayerVisitor(flatRegion, minimumBlockY(region), maximumBlockY(region), naturalizer); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return naturalizer.getAffected(); } @@ -1077,7 +1077,7 @@ public class EditSession implements Extent { if (!copyAir) { copy.setSourceMask(new ExistingBlockMask(this)); } - OperationHelper.completeLegacy(copy); + Operations.completeLegacy(copy); return copy.getAffected(); } @@ -1119,7 +1119,7 @@ public class EditSession implements Extent { RegionVisitor visitor = new RegionVisitor(buffer.asRegion(), replace); OperationQueue operation = new OperationQueue(copy, visitor); - OperationHelper.completeLegacy(operation); + Operations.completeLegacy(operation); return copy.getAffected(); } @@ -1166,7 +1166,7 @@ public class EditSession implements Extent { } } - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return visitor.getAffected(); } @@ -1214,7 +1214,7 @@ public class EditSession implements Extent { } } - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return visitor.getAffected(); } @@ -1684,7 +1684,7 @@ public class EditSession implements Extent { 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)); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); return ground.getAffected(); } diff --git a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java index 81ed16b58..b0e2f7442 100644 --- a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java @@ -28,13 +28,13 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.expression.ExpressionException; 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.HeightMap; import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.function.GroundFunction; import com.sk89q.worldedit.function.generator.FloraGenerator; 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.masks.Mask; import com.sk89q.worldedit.function.mask.NoiseFilter2D; @@ -555,7 +555,7 @@ public class RegionCommands { GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); player.print(ground.getAffected() + " trees created."); } @@ -577,7 +577,7 @@ public class RegionCommands { GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); - OperationHelper.completeLegacy(visitor); + Operations.completeLegacy(visitor); player.print(ground.getAffected() + " flora created."); } diff --git a/src/main/java/com/sk89q/worldedit/function/operation/OperationHelper.java b/src/main/java/com/sk89q/worldedit/function/operation/Operations.java similarity index 97% rename from src/main/java/com/sk89q/worldedit/function/operation/OperationHelper.java rename to src/main/java/com/sk89q/worldedit/function/operation/Operations.java index 579045a0f..4e84305d8 100644 --- a/src/main/java/com/sk89q/worldedit/function/operation/OperationHelper.java +++ b/src/main/java/com/sk89q/worldedit/function/operation/Operations.java @@ -25,9 +25,9 @@ import com.sk89q.worldedit.WorldEditException; /** * Operation helper methods. */ -public final class OperationHelper { +public final class Operations { - private OperationHelper() { + private Operations() { } /**