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 Command command,
|
||||||
@NotNull String label,
|
@NotNull String label,
|
||||||
@NotNull String[] args) {
|
@NotNull String[] args) {
|
||||||
// set, get, remove
|
// set, get, remove, gui
|
||||||
if (!sender.hasPermission("sr.attributes")) {
|
if (!sender.hasPermission("sr.attributes")) {
|
||||||
sender.sendMessage("Unknown command. Type \"/help\" for help.");
|
sender.sendMessage("Unknown command. Type \"/help\" for help.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (args.length <= 2) {
|
if (args.length < 2) {
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
"Usage: /attribute <set|get|remove|gui> <player|item-in-hand> <attribute> [value]");
|
"Usage: /attribute <set|get|remove|gui> <player|item-in-hand> <attribute> [value]");
|
||||||
return true;
|
return true;
|
||||||
|
@ -159,7 +159,7 @@ public class AttributeCommand implements TabExecutor {
|
||||||
Attribute attribute;
|
Attribute attribute;
|
||||||
try {
|
try {
|
||||||
attribute = Attribute.valueOf(args[2].toUpperCase());
|
attribute = Attribute.valueOf(args[2].toUpperCase());
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
|
||||||
sender.sendMessage("Attribute not found.");
|
sender.sendMessage("Attribute not found.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ public class AttributeCommand implements TabExecutor {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
return List.of("set", "get", "remove");
|
return List.of("set", "get", "gui", "remove");
|
||||||
}
|
}
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
List<String> players =
|
List<String> players =
|
||||||
|
|
|
@ -94,6 +94,7 @@ public class AttributeItem extends AbstractItem {
|
||||||
} else if (clickType == ClickType.SHIFT_RIGHT) {
|
} else if (clickType == ClickType.SHIFT_RIGHT) {
|
||||||
sp.setAttribute(attribute, sp.getAttribute(attribute) - 10);
|
sp.setAttribute(attribute, sp.getAttribute(attribute) - 10);
|
||||||
}
|
}
|
||||||
|
playerManager.savePlayer(sp);
|
||||||
notifyWindows();
|
notifyWindows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue