mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-01-01 18:27:35 +01:00
Added #shulker_box tag to target all shulker box types (#493)
This commit is contained in:
parent
e61b8a4d9b
commit
377a6f55b9
@ -35,6 +35,7 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
private static CommandHandler instance;
|
private static CommandHandler instance;
|
||||||
private static ConcurrentHashMap<String, Boolean> versionAlert = new ConcurrentHashMap<>();
|
private static ConcurrentHashMap<String, Boolean> versionAlert = new ConcurrentHashMap<>();
|
||||||
protected static Set<Material> naturalBlocks = BlockGroup.NATURAL_BLOCKS;
|
protected static Set<Material> naturalBlocks = BlockGroup.NATURAL_BLOCKS;
|
||||||
|
protected static Set<Material> shulkerBlocks = BlockGroup.SHULKER_BOXES;
|
||||||
|
|
||||||
public static CommandHandler getInstance() {
|
public static CommandHandler getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@ -282,6 +283,11 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
excluded.put(block, false);
|
excluded.put(block, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (i3.equals("#shulker_box")) {
|
||||||
|
for (Material block : shulkerBlocks) {
|
||||||
|
excluded.put(block, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Material i3_material = Util.getType(i3);
|
Material i3_material = Util.getType(i3);
|
||||||
if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) {
|
if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) {
|
||||||
@ -311,6 +317,11 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
excluded.put(block, false);
|
excluded.put(block, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (argument.equals("#shulker_box")) {
|
||||||
|
for (Material block : shulkerBlocks) {
|
||||||
|
excluded.put(block, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Material iMaterial = Util.getType(argument);
|
Material iMaterial = Util.getType(argument);
|
||||||
if (iMaterial != null && (iMaterial.isBlock() || argAction.contains(4))) {
|
if (iMaterial != null && (iMaterial.isBlock() || argAction.contains(4))) {
|
||||||
@ -359,7 +370,7 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
String[] i2 = argument.split(",");
|
String[] i2 = argument.split(",");
|
||||||
for (String i3 : i2) {
|
for (String i3 : i2) {
|
||||||
boolean isBlock = false;
|
boolean isBlock = false;
|
||||||
if (i3.equals("#natural")) {
|
if (i3.equals("#natural") || i3.equals("#shulker_box")) {
|
||||||
isBlock = true;
|
isBlock = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -387,7 +398,7 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
boolean isBlock = false;
|
boolean isBlock = false;
|
||||||
if (argument.equals("#natural")) {
|
if (argument.equals("#natural") || argument.equals("#shulker_box")) {
|
||||||
isBlock = true;
|
isBlock = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -633,6 +644,9 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
if (i3.equals("#natural")) {
|
if (i3.equals("#natural")) {
|
||||||
restricted.addAll(naturalBlocks);
|
restricted.addAll(naturalBlocks);
|
||||||
}
|
}
|
||||||
|
else if (i3.equals("#shulker_box")) {
|
||||||
|
restricted.addAll(shulkerBlocks);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Material i3_material = Util.getType(i3);
|
Material i3_material = Util.getType(i3);
|
||||||
if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) {
|
if (i3_material != null && (i3_material.isBlock() || argAction.contains(4))) {
|
||||||
@ -665,6 +679,9 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
if (argument.equals("#natural")) {
|
if (argument.equals("#natural")) {
|
||||||
restricted.addAll(naturalBlocks);
|
restricted.addAll(naturalBlocks);
|
||||||
}
|
}
|
||||||
|
else if (argument.equals("#shulker_box")) {
|
||||||
|
restricted.addAll(shulkerBlocks);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Material material = Util.getType(argument);
|
Material material = Util.getType(argument);
|
||||||
if (material != null && (material.isBlock() || argAction.contains(4))) {
|
if (material != null && (material.isBlock() || argAction.contains(4))) {
|
||||||
|
@ -317,6 +317,10 @@ public class TabHandler implements TabCompleter {
|
|||||||
materialList.add(add.name().toLowerCase(Locale.ROOT));
|
materialList.add(add.name().toLowerCase(Locale.ROOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add custom tags
|
||||||
|
materialList.add("#natural");
|
||||||
|
materialList.add("#shulker_box");
|
||||||
|
|
||||||
materials = new ArrayList<>(materialList);
|
materials = new ArrayList<>(materialList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user