Renamed Brush to BrushTool, and BrushShape to Brush.

This commit is contained in:
sk89q 2011-02-18 23:36:08 -08:00
parent 498f3d9ef1
commit 7f25262572
9 changed files with 21 additions and 21 deletions

View File

@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Map; import java.util.Map;
import com.sk89q.worldedit.snapshots.Snapshot; import com.sk89q.worldedit.snapshots.Snapshot;
import com.sk89q.worldedit.tools.Brush; import com.sk89q.worldedit.tools.BrushTool;
import com.sk89q.worldedit.tools.SinglePickaxe; import com.sk89q.worldedit.tools.SinglePickaxe;
import com.sk89q.worldedit.tools.BlockTool; import com.sk89q.worldedit.tools.BlockTool;
import com.sk89q.worldedit.tools.Tool; import com.sk89q.worldedit.tools.Tool;
@ -433,15 +433,15 @@ public class LocalSession {
* @return the tool * @return the tool
* @throws InvalidToolBindException * @throws InvalidToolBindException
*/ */
public Brush getBrushTool(int item) throws InvalidToolBindException { public BrushTool getBrushTool(int item) throws InvalidToolBindException {
Tool tool = getTool(item); Tool tool = getTool(item);
if (tool == null || !(tool instanceof Brush)) { if (tool == null || !(tool instanceof BrushTool)) {
tool = new Brush(); tool = new BrushTool();
setTool(item, tool); setTool(item, tool);
} }
return (Brush)tool; return (BrushTool)tool;
} }
/** /**

View File

@ -31,7 +31,7 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
import com.sk89q.worldedit.tools.Brush; import com.sk89q.worldedit.tools.BrushTool;
import com.sk89q.worldedit.tools.brushes.ClipboardBrush; import com.sk89q.worldedit.tools.brushes.ClipboardBrush;
import com.sk89q.worldedit.tools.brushes.CylinderBrush; import com.sk89q.worldedit.tools.brushes.CylinderBrush;
import com.sk89q.worldedit.tools.brushes.HollowCylinderBrush; import com.sk89q.worldedit.tools.brushes.HollowCylinderBrush;
@ -66,7 +66,7 @@ public class BrushCommands {
return; return;
} }
Brush tool = session.getBrushTool(player.getItemInHand()); BrushTool tool = session.getBrushTool(player.getItemInHand());
Pattern fill = we.getBlockPattern(player, args.getString(0)); Pattern fill = we.getBlockPattern(player, args.getString(0));
tool.setFill(fill); tool.setFill(fill);
tool.setSize(radius); tool.setSize(radius);
@ -110,7 +110,7 @@ public class BrushCommands {
return; return;
} }
Brush tool = session.getBrushTool(player.getItemInHand()); BrushTool tool = session.getBrushTool(player.getItemInHand());
Pattern fill = we.getBlockPattern(player, args.getString(0)); Pattern fill = we.getBlockPattern(player, args.getString(0));
tool.setFill(fill); tool.setFill(fill);
tool.setSize(radius); tool.setSize(radius);
@ -157,7 +157,7 @@ public class BrushCommands {
return; return;
} }
Brush tool = session.getBrushTool(player.getItemInHand()); BrushTool tool = session.getBrushTool(player.getItemInHand());
tool.setBrush(new ClipboardBrush(clipboard, args.hasFlag('a'))); tool.setBrush(new ClipboardBrush(clipboard, args.hasFlag('a')));
player.print("Clipboard brush shape equipped."); player.print("Clipboard brush shape equipped.");

View File

@ -26,7 +26,7 @@ import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.masks.Mask; import com.sk89q.worldedit.masks.Mask;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
import com.sk89q.worldedit.patterns.SingleBlockPattern; import com.sk89q.worldedit.patterns.SingleBlockPattern;
import com.sk89q.worldedit.tools.brushes.BrushShape; import com.sk89q.worldedit.tools.brushes.Brush;
import com.sk89q.worldedit.tools.brushes.SphereBrush; import com.sk89q.worldedit.tools.brushes.SphereBrush;
/** /**
@ -34,9 +34,9 @@ import com.sk89q.worldedit.tools.brushes.SphereBrush;
* *
* @author sk89q * @author sk89q
*/ */
public class Brush implements TraceTool { public class BrushTool implements TraceTool {
private Mask mask = null; private Mask mask = null;
private BrushShape brush = new SphereBrush(); private Brush brush = new SphereBrush();
private Pattern material = new SingleBlockPattern(new BaseBlock(BlockID.COBBLESTONE)); private Pattern material = new SingleBlockPattern(new BaseBlock(BlockID.COBBLESTONE));
private int size = 1; private int size = 1;
@ -63,7 +63,7 @@ public class Brush implements TraceTool {
* *
* @param brush * @param brush
*/ */
public void setBrush(BrushShape brush) { public void setBrush(Brush brush) {
this.brush = brush; this.brush = brush;
} }
@ -72,7 +72,7 @@ public class Brush implements TraceTool {
* *
* @return * @return
*/ */
public BrushShape getBrush() { public Brush getBrush() {
return brush; return brush;
} }

View File

@ -25,11 +25,11 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
/** /**
* Represents a shape. * Represents a brush.
* *
* @author sk89q * @author sk89q
*/ */
public interface BrushShape { public interface Brush {
/** /**
* Build the object. * Build the object.
* *

View File

@ -25,7 +25,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
public class ClipboardBrush implements BrushShape { public class ClipboardBrush implements Brush {
private CuboidClipboard clipboard; private CuboidClipboard clipboard;
private boolean noAir; private boolean noAir;

View File

@ -24,7 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
public class CylinderBrush implements BrushShape { public class CylinderBrush implements Brush {
private int height; private int height;
public CylinderBrush(int height) { public CylinderBrush(int height) {

View File

@ -24,7 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
public class HollowCylinderBrush implements BrushShape { public class HollowCylinderBrush implements Brush {
private int height; private int height;
public HollowCylinderBrush(int height) { public HollowCylinderBrush(int height) {

View File

@ -24,7 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
public class HollowSphereBrush implements BrushShape { public class HollowSphereBrush implements Brush {
public HollowSphereBrush() { public HollowSphereBrush() {
} }

View File

@ -24,7 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.patterns.Pattern;
public class SphereBrush implements BrushShape { public class SphereBrush implements Brush {
public SphereBrush() { public SphereBrush() {
} }