mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-27 22:58:41 +02:00
Update CommandAction.java
This commit is contained in:
parent
1fcf826fb3
commit
dab31dba51
@ -36,7 +36,7 @@ public class CommandAction extends NPCShopAction {
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
String description = commands.size() + " command";
|
||||
String description = commands.size() + " 命令";
|
||||
for (int i = 0; i < commands.size(); i++) {
|
||||
description += "\n" + commands.get(i);
|
||||
if (i == 3) {
|
||||
@ -82,7 +82,7 @@ public class CommandAction extends NPCShopAction {
|
||||
});
|
||||
}
|
||||
|
||||
@Menu(title = "Command editor", dimensions = { 4, 9 })
|
||||
@Menu(title = "命令编辑器", dimensions = { 4, 9 })
|
||||
public static class CommandActionEditor extends InventoryMenuPage {
|
||||
private CommandAction base;
|
||||
private Consumer<NPCShopAction> callback;
|
||||
@ -101,8 +101,8 @@ public class CommandAction extends NPCShopAction {
|
||||
int idx = i;
|
||||
ctx.getSlot(i).clear();
|
||||
if (i < base.commands.size()) {
|
||||
ctx.getSlot(i).setItemStack(new ItemStack(Material.FEATHER), "<f>Set command",
|
||||
"Right click to remove\nCurrently: " + base.commands.get(i));
|
||||
ctx.getSlot(i).setItemStack(new ItemStack(Material.FEATHER), "<f>设置命令",
|
||||
"右键删除\n当前: " + base.commands.get(i));
|
||||
}
|
||||
ctx.getSlot(i).setClickHandler(event -> {
|
||||
if (event.isRightClick()) {
|
||||
@ -130,14 +130,14 @@ public class CommandAction extends NPCShopAction {
|
||||
});
|
||||
}
|
||||
ctx.getSlot(3 * 9 + 3).setItemStack(new ItemStack(Util.getFallbackMaterial("COMMAND_BLOCK", "COMMAND")),
|
||||
"Run commands as server", base.server ? ChatColor.GREEN + "On" : ChatColor.RED + "OFF");
|
||||
"以服务器身份运行指令", base.server ? ChatColor.GREEN + "开" : ChatColor.RED + "关");
|
||||
ctx.getSlot(3 * 9 + 3).addClickHandler(InputMenus.toggler(res -> base.server = res, base.server));
|
||||
ctx.getSlot(3 * 9 + 4).setItemStack(
|
||||
new ItemStack(Util.getFallbackMaterial("COMPARATOR", "REDSTONE_COMPARATOR")), "Run commands as op",
|
||||
base.op ? ChatColor.GREEN + "On" : ChatColor.RED + "OFF");
|
||||
new ItemStack(Util.getFallbackMaterial("COMPARATOR", "REDSTONE_COMPARATOR")), "以OP 身份运行指令",
|
||||
base.op ? ChatColor.GREEN + "开" : ChatColor.RED + "关");
|
||||
ctx.getSlot(3 * 9 + 4).addClickHandler(InputMenus.clickToggle(res -> {
|
||||
base.op = res;
|
||||
return res ? ChatColor.GREEN + "On" : ChatColor.RED + "Off";
|
||||
return res ? ChatColor.GREEN + "开" : ChatColor.RED + "关";
|
||||
}, base.server));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user