SteamWar/BauSystem2.0
Archiviert
12
0

Fix CustomCommandListener

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-08-24 18:38:49 +02:00
Ursprung b68bbdca14
Commit d43e4cd10c
2 geänderte Dateien mit 10 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -41,7 +41,7 @@ public class SlotCommand extends SWCommand {
}
@Register(help = true)
public void genericHelp(Player p) {
public void genericHelp(Player p, String... args) {
BauSystem.MESSAGE.send("OTHER_NOCLIP_SLOT_INFO", p);
}

Datei anzeigen

@ -245,14 +245,16 @@ public class CustomCommandListener implements Listener {
});
int length = (int) output(p).toYAPION(new LengthOutput()).getLength();
StringBuilder menuName = new StringBuilder();
menuName.append("§eScript Commands");
if (length > 58982) {
if (length == 655336) {
menuName.append(" §8(§cVoll§8)");
menuName.append("§eScript Commands ");
double percentage = ((int) ((length / 655336.0) * 1000)) / 10.0;
if (percentage > 99) {
menuName.append("§c");
} else if (percentage >= 75) {
menuName.append("§6");
} 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) -> {
if (!clickType.isCreativeAction()) {
playerMap.get(p).removeIf(customCommand -> customCommand == menuCommand);