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) @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);
} }

Datei anzeigen

@ -245,14 +245,16 @@ 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 { } else if (percentage >= 75) {
menuName.append(" §8(§6Fast Voll§8)"); menuName.append("§6");
} } else {
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);