Fix CustomCommandListener
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
b68bbdca14
Commit
d43e4cd10c
@ -41,7 +41,7 @@ public class SlotCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p) {
|
public void genericHelp(Player p, String... args) {
|
||||||
BauSystem.MESSAGE.send("OTHER_NOCLIP_SLOT_INFO", p);
|
BauSystem.MESSAGE.send("OTHER_NOCLIP_SLOT_INFO", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,13 +246,15 @@ public class CustomCommandListener implements Listener {
|
|||||||
int length = (int) output(p).toYAPION(new LengthOutput()).getLength();
|
int length = (int) output(p).toYAPION(new LengthOutput()).getLength();
|
||||||
StringBuilder menuName = new StringBuilder();
|
StringBuilder menuName = new StringBuilder();
|
||||||
menuName.append("§eScript Commands ");
|
menuName.append("§eScript Commands ");
|
||||||
if (length > 58982) {
|
double percentage = ((int) ((length / 655336.0) * 1000)) / 10.0;
|
||||||
if (length == 655336) {
|
if (percentage > 99) {
|
||||||
menuName.append(" §8(§cVoll§8)");
|
menuName.append("§c");
|
||||||
|
} else if (percentage >= 75) {
|
||||||
|
menuName.append("§6");
|
||||||
} else {
|
} else {
|
||||||
menuName.append(" §8(§6Fast Voll§8)");
|
menuName.append("§a");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
menuName.append(percentage).append("§7%");
|
||||||
SWListInv<MenuCommand> menuCommandSWListInv = new SWListInv<>(p, menuName.toString(), false, menuCommands, (clickType, menuCommand) -> {
|
SWListInv<MenuCommand> menuCommandSWListInv = new SWListInv<>(p, menuName.toString(), false, menuCommands, (clickType, menuCommand) -> {
|
||||||
if (!clickType.isCreativeAction()) {
|
if (!clickType.isCreativeAction()) {
|
||||||
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);
|
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren