The dupeban editor randomly decided to break
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
/.idea/
|
/.idea/
|
||||||
/.gradle/
|
/.gradle/
|
||||||
/build/
|
/build/
|
||||||
|
/.gradle/
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,13 @@ public class UltraDupeCommand implements CustomCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispatchCompletions(CompletionBuilder b) {
|
public void dispatchCompletions(CompletionBuilder b) {
|
||||||
b.then(b.arg("[<INT>]"));
|
b.then(b.arg("dupebans")
|
||||||
|
.then(b.arg("item")
|
||||||
|
.then(b.arg("add","remove")))
|
||||||
|
.then(b.arg("material")
|
||||||
|
.then(b.arg("add", "remove")))
|
||||||
|
).then(b.arg("toggle")
|
||||||
|
.then(b.arg("debug","bypass")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleItemEdit(Player p, Args args) {
|
private void handleItemEdit(Player p, Args args) {
|
||||||
@@ -98,14 +104,14 @@ public class UltraDupeCommand implements CustomCommand {
|
|||||||
}
|
}
|
||||||
switch (args.get(2).toString()) {
|
switch (args.get(2).toString()) {
|
||||||
case "add" -> {
|
case "add" -> {
|
||||||
|
|
||||||
Material m = p.getInventory().getItemInMainHand().getType();
|
Material m = p.getInventory().getItemInMainHand().getType();
|
||||||
if (UltraDupe.dupeBanStorage.bannedMaterials.contains(m)) {
|
if (UltraDupe.dupeBanStorage.bannedMaterials.contains(m)) {
|
||||||
p.sendMessage(Component.text(Text.prefix("&7The material &c%s&7 is already on the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
p.sendMessage(Component.text(Text.prefix("&7The material &c%s&7 is already on the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
p.sendMessage(Component.text(Text.prefix("&7Adding &c%s&7 to the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
||||||
UltraDupe.dupeBanStorage.bannedMaterials.add(m);
|
UltraDupe.dupeBanStorage.bannedMaterials.add(m);
|
||||||
p.sendMessage(Component.text(Text.prefix("&7You have added &c%s&7 to the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
|
||||||
UltraDupe.dupeBanStorage.save();
|
UltraDupe.dupeBanStorage.save();
|
||||||
}
|
}
|
||||||
case "remove" -> {
|
case "remove" -> {
|
||||||
@@ -114,8 +120,8 @@ public class UltraDupeCommand implements CustomCommand {
|
|||||||
p.sendMessage(Component.text(Text.prefix("&7The material &c%s&7 is not on the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
p.sendMessage(Component.text(Text.prefix("&7The material &c%s&7 is not on the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
p.sendMessage(Component.text(Text.prefix("&7Removing&a%s&7 from the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
||||||
UltraDupe.dupeBanStorage.bannedMaterials.remove(m);
|
UltraDupe.dupeBanStorage.bannedMaterials.remove(m);
|
||||||
p.sendMessage(Component.text(Text.prefix("&7You have removed &a%s&7 from the dupe ban list.".formatted(Text.cleanName(m.toString())))));
|
|
||||||
UltraDupe.dupeBanStorage.save();
|
UltraDupe.dupeBanStorage.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,23 +29,29 @@ permissions:
|
|||||||
description: edit the dupe ban list
|
description: edit the dupe ban list
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
ultradupe:
|
||||||
|
description: Admin command to edit and bypass dupebans
|
||||||
|
usage: /ultradupe
|
||||||
|
permission: ultradupe.admin
|
||||||
|
aliases:
|
||||||
|
- ud
|
||||||
duplicate:
|
duplicate:
|
||||||
description: A command for testing.
|
description: A command for testing.
|
||||||
usage: /ultradupe
|
usage: /dupe [int]
|
||||||
permission: ultradupe.info
|
permission: ultradupe.dupe
|
||||||
permission-message: You do not have permission!
|
permission-message: You do not have permission!
|
||||||
aliases:
|
aliases:
|
||||||
- dupe
|
- dupe
|
||||||
- d
|
- d
|
||||||
multiply:
|
multiply:
|
||||||
description: A command for testing.
|
description: A command for testing.
|
||||||
usage: /ultradupe
|
usage: /multiply [int]
|
||||||
permission: ultradupe.info
|
permission: ultradupe.multiply
|
||||||
permission-message: You do not have permission!
|
permission-message: You do not have permission!
|
||||||
aliases:
|
aliases:
|
||||||
- mult
|
- mult
|
||||||
- m
|
- m
|
||||||
dupebans:
|
dupebans:
|
||||||
description: dupe bans
|
description: dupe bans
|
||||||
usage: /dupebans [add|remove]
|
usage: /dupebans
|
||||||
permission: ultradupe.dupebans
|
permission: ultradupe.dupebans
|
||||||
Reference in New Issue
Block a user