diff --git a/src/main/java/net/coreprotect/command/CommandHandler.java b/src/main/java/net/coreprotect/command/CommandHandler.java index 596a4be..923d0ac 100755 --- a/src/main/java/net/coreprotect/command/CommandHandler.java +++ b/src/main/java/net/coreprotect/command/CommandHandler.java @@ -35,6 +35,7 @@ public class CommandHandler implements CommandExecutor { private static CommandHandler instance; private static ConcurrentHashMap versionAlert = new ConcurrentHashMap<>(); protected static Set naturalBlocks = BlockGroup.NATURAL_BLOCKS; + protected static Set shulkerBlocks = BlockGroup.SHULKER_BOXES; public static CommandHandler getInstance() { if (instance == null) { @@ -282,6 +283,11 @@ public class CommandHandler implements CommandExecutor { excluded.put(block, false); } } + else if (i3.equals("#shulker_box")) { + for (Material block : shulkerBlocks) { + excluded.put(block, false); + } + } else { Material i3_material = Util.getType(i3); if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) { @@ -311,6 +317,11 @@ public class CommandHandler implements CommandExecutor { excluded.put(block, false); } } + else if (argument.equals("#shulker_box")) { + for (Material block : shulkerBlocks) { + excluded.put(block, false); + } + } else { Material iMaterial = Util.getType(argument); if (iMaterial != null && (iMaterial.isBlock() || argAction.contains(4))) { @@ -359,7 +370,7 @@ public class CommandHandler implements CommandExecutor { String[] i2 = argument.split(","); for (String i3 : i2) { boolean isBlock = false; - if (i3.equals("#natural")) { + if (i3.equals("#natural") || i3.equals("#shulker_box")) { isBlock = true; } else { @@ -387,7 +398,7 @@ public class CommandHandler implements CommandExecutor { } else { boolean isBlock = false; - if (argument.equals("#natural")) { + if (argument.equals("#natural") || argument.equals("#shulker_box")) { isBlock = true; } else { @@ -633,6 +644,9 @@ public class CommandHandler implements CommandExecutor { if (i3.equals("#natural")) { restricted.addAll(naturalBlocks); } + else if (i3.equals("#shulker_box")) { + restricted.addAll(shulkerBlocks); + } else { Material i3_material = Util.getType(i3); if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) { @@ -665,6 +679,9 @@ public class CommandHandler implements CommandExecutor { if (argument.equals("#natural")) { restricted.addAll(naturalBlocks); } + else if (argument.equals("#shulker_box")) { + restricted.addAll(shulkerBlocks); + } else { Material material = Util.getType(argument); if (material != null && (material.isBlock() || argAction.contains(4))) { diff --git a/src/main/java/net/coreprotect/command/TabHandler.java b/src/main/java/net/coreprotect/command/TabHandler.java index e34d509..bbff8f5 100755 --- a/src/main/java/net/coreprotect/command/TabHandler.java +++ b/src/main/java/net/coreprotect/command/TabHandler.java @@ -317,6 +317,10 @@ public class TabHandler implements TabCompleter { materialList.add(add.name().toLowerCase(Locale.ROOT)); } + // add custom tags + materialList.add("#natural"); + materialList.add("#shulker_box"); + materials = new ArrayList<>(materialList); }