Removed references to the deprecated BlockTypeMask class from UnderOverlayMask.

This commit is contained in:
TomyLobo 2013-10-29 08:03:37 +01:00
parent 6beba674cb
commit ae6e59e8d0

View File

@ -25,6 +25,7 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
/** /**
* *
@ -32,7 +33,7 @@ import com.sk89q.worldedit.Vector;
*/ */
public class UnderOverlayMask implements Mask { public class UnderOverlayMask implements Mask {
private final int yMod; private final int yMod;
private Mask mask; // TODO: Make this final and remove the deprecated classes private Mask mask;
@Deprecated @Deprecated
public UnderOverlayMask(Set<Integer> ids, boolean overlay) { public UnderOverlayMask(Set<Integer> ids, boolean overlay) {
@ -46,13 +47,17 @@ public class UnderOverlayMask implements Mask {
@Deprecated @Deprecated
public void addAll(Set<Integer> ids) { public void addAll(Set<Integer> ids) {
if (mask instanceof BlockTypeMask) { if (mask instanceof BlockMask) {
BlockTypeMask blockTypeMask = (BlockTypeMask) mask; final BlockMask blockTypeMask = (BlockMask) mask;
for (Integer id : ids) { for (Integer id : ids) {
blockTypeMask.add(id); blockTypeMask.add(new BaseBlock(id));
} }
} else if (mask instanceof ExistingBlockMask) { } 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;
} }
} }