From ae6e59e8d097786e295e01a13c9880c4703449b7 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Tue, 29 Oct 2013 08:03:37 +0100 Subject: [PATCH] Removed references to the deprecated BlockTypeMask class from UnderOverlayMask. --- .../sk89q/worldedit/masks/UnderOverlayMask.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/masks/UnderOverlayMask.java b/src/main/java/com/sk89q/worldedit/masks/UnderOverlayMask.java index c5a5add08..f2426e429 100644 --- a/src/main/java/com/sk89q/worldedit/masks/UnderOverlayMask.java +++ b/src/main/java/com/sk89q/worldedit/masks/UnderOverlayMask.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseBlock; /** * @@ -32,11 +33,11 @@ import com.sk89q.worldedit.Vector; */ public class UnderOverlayMask implements Mask { private final int yMod; - private Mask mask; // TODO: Make this final and remove the deprecated classes + private Mask mask; @Deprecated public UnderOverlayMask(Set ids, boolean overlay) { - this(new BlockTypeMask(ids), overlay); + this(new BlockTypeMask(ids), overlay); } public UnderOverlayMask(Mask mask, boolean overlay) { @@ -46,13 +47,17 @@ public class UnderOverlayMask implements Mask { @Deprecated public void addAll(Set ids) { - if (mask instanceof BlockTypeMask) { - BlockTypeMask blockTypeMask = (BlockTypeMask) mask; + if (mask instanceof BlockMask) { + final BlockMask blockTypeMask = (BlockMask) mask; for (Integer id : ids) { - blockTypeMask.add(id); + blockTypeMask.add(new BaseBlock(id)); } } else if (mask instanceof ExistingBlockMask) { - mask = new BlockTypeMask(ids); + final BlockMask blockMask = new BlockMask(); + for (int type : ids) { + blockMask.add(new BaseBlock(type)); + } + mask = blockMask; } }