attribute gui save and bug patch
All checks were successful
Build / build (push) Successful in 1m26s
All checks were successful
Build / build (push) Successful in 1m26s
This commit is contained in:
parent
0af15fbd5a
commit
474318d210
2 changed files with 5 additions and 4 deletions
|
@ -53,12 +53,12 @@ public class AttributeCommand implements TabExecutor {
|
|||
@NotNull Command command,
|
||||
@NotNull String label,
|
||||
@NotNull String[] args) {
|
||||
// set, get, remove
|
||||
// set, get, remove, gui
|
||||
if (!sender.hasPermission("sr.attributes")) {
|
||||
sender.sendMessage("Unknown command. Type \"/help\" for help.");
|
||||
return true;
|
||||
}
|
||||
if (args.length <= 2) {
|
||||
if (args.length < 2) {
|
||||
sender.sendMessage(
|
||||
"Usage: /attribute <set|get|remove|gui> <player|item-in-hand> <attribute> [value]");
|
||||
return true;
|
||||
|
@ -159,7 +159,7 @@ public class AttributeCommand implements TabExecutor {
|
|||
Attribute attribute;
|
||||
try {
|
||||
attribute = Attribute.valueOf(args[2].toUpperCase());
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
|
||||
sender.sendMessage("Attribute not found.");
|
||||
return true;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ public class AttributeCommand implements TabExecutor {
|
|||
return null;
|
||||
}
|
||||
if (args.length == 1) {
|
||||
return List.of("set", "get", "remove");
|
||||
return List.of("set", "get", "gui", "remove");
|
||||
}
|
||||
if (args.length == 2) {
|
||||
List<String> players =
|
||||
|
|
|
@ -94,6 +94,7 @@ public class AttributeItem extends AbstractItem {
|
|||
} else if (clickType == ClickType.SHIFT_RIGHT) {
|
||||
sp.setAttribute(attribute, sp.getAttribute(attribute) - 10);
|
||||
}
|
||||
playerManager.savePlayer(sp);
|
||||
notifyWindows();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue