diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/brush/BlockResetBrush.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/brush/BlockResetBrush.java index f2383e69c..538212094 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/brush/BlockResetBrush.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/brush/BlockResetBrush.java @@ -1,5 +1,6 @@ package com.thevoxelbox.voxelsniper.brush; +import com.sk89q.worldedit.world.block.BlockID; import com.thevoxelbox.voxelsniper.Message; import com.thevoxelbox.voxelsniper.SnipeData; import org.bukkit.Material; @@ -11,8 +12,18 @@ public class BlockResetBrush extends Brush { private static final ArrayList DENIED_UPDATES = new ArrayList<>(); static { - BlockResetBrush.DENIED_UPDATES.add(Material.SIGN); - BlockResetBrush.DENIED_UPDATES.add(Material.WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.ACACIA_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.SPRUCE_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.ACACIA_WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.BIRCH_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.SPRUCE_WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.BIRCH_WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.DARK_OAK_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.DARK_OAK_WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.JUNGLE_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.JUNGLE_WALL_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.OAK_SIGN); + BlockResetBrush.DENIED_UPDATES.add(Material.OAK_WALL_SIGN); BlockResetBrush.DENIED_UPDATES.add(Material.CHEST); BlockResetBrush.DENIED_UPDATES.add(Material.FURNACE); BlockResetBrush.DENIED_UPDATES.add(Material.REDSTONE_TORCH); diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java index a5874f10e..a360d5a0a 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java @@ -11,7 +11,7 @@ import org.bukkit.block.data.BlockData; */ public class VoxelList { - private BlockMask mask = new BlockMask(); + private BlockMask mask = new BlockMask(new NullExtent()); /** * Adds the specified id, data value pair to the VoxelList. A data value of -1 will operate on all data values of that id. @@ -19,7 +19,7 @@ public class VoxelList { * @param i */ public void add(BlockState i) { - this.mask = mask.toBuilder().add(i).build(NullExtent.INSTANCE); + this.mask = mask.add(i); } public void add(BlockMask mask) { @@ -32,7 +32,7 @@ public class VoxelList { * @return true if this list contained the specified element */ public boolean removeValue(final BlockState state) { - this.mask = mask.toBuilder().remove(state).build(NullExtent.INSTANCE); + this.mask = mask.remove(state); return true; } @@ -53,7 +53,7 @@ public class VoxelList { * Clears the VoxelList. */ public void clear() { - mask = mask.toBuilder().clear().build(NullExtent.INSTANCE); + mask = mask.clear(); } /** @@ -62,7 +62,7 @@ public class VoxelList { * @return true if this list contains no elements */ public boolean isEmpty() { - return mask.toBuilder().isEmpty(); + return mask.isEmpty(); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java index 3eec8fde1..ae9f7bc79 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java @@ -67,6 +67,23 @@ public class BlockMask extends ABlockMask { return this; } + public BlockMask remove(BlockState... states) { + for (BlockState state : states) ordinals[state.getOrdinal()] = false; + return this; + } + + public BlockMask clear() { + Arrays.fill(ordinals, false); + return this; + } + + public boolean isEmpty() { + for (boolean value : ordinals) { + if (value) return false; + } + return true; + } + public BlockMask addStates(Collection states) { for (BlockState state : states) ordinals[state.getOrdinal()] = true; return this;