From 271f9b9ec53e6d878c60b4007b4d4351985973f9 Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Sun, 24 Apr 2022 22:42:44 +0800 Subject: [PATCH] Revert "Corrected format" This reverts commit 153593b64c57e68ce275b6138c5e17d83371f863. --- .../java/emu/grasscutter/command/Command.java | 2 +- .../emu/grasscutter/command/CommandMap.java | 2 -- .../command/commands/GiveAllCommand.java | 23 +++++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/Command.java b/src/main/java/emu/grasscutter/command/Command.java index a0edc5cdc..c38568d65 100644 --- a/src/main/java/emu/grasscutter/command/Command.java +++ b/src/main/java/emu/grasscutter/command/Command.java @@ -15,5 +15,5 @@ public @interface Command { String permission() default ""; - boolean threading() default false; + boolean threading() default false; } diff --git a/src/main/java/emu/grasscutter/command/CommandMap.java b/src/main/java/emu/grasscutter/command/CommandMap.java index f104e3bfc..19ab687ad 100644 --- a/src/main/java/emu/grasscutter/command/CommandMap.java +++ b/src/main/java/emu/grasscutter/command/CommandMap.java @@ -136,11 +136,9 @@ public final class CommandMap { } // Invoke execute method for handler. - // Get whether the command starts a thread boolean threading = this.annotations.get(label).threading(); Runnable runnable = () -> handler.execute(player, args); if(threading) { - //start thread Thread command = new Thread(runnable); command.start(); } diff --git a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java index d817b2967..ad4240b01 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java @@ -1,5 +1,6 @@ package emu.grasscutter.command.commands; +import com.thoughtworks.proxy.toys.nullobject.Null; import emu.grasscutter.Grasscutter; import emu.grasscutter.command.Command; import emu.grasscutter.command.CommandHandler; @@ -21,7 +22,7 @@ public class GiveAllCommand implements CommandHandler { int target,amount=99999; switch (args.size()) { - default: // *no args* + default: // giveall *no args* try { target = sender.getUid(); }catch (NullPointerException ignored){ @@ -37,7 +38,7 @@ public class GiveAllCommand implements CommandHandler { return; } }catch (NumberFormatException ignored){ - CommandHandler.sendMessage(sender, "Invalid player ID."); + CommandHandler.sendMessage(sender, "Invalid amount or player ID."); return; } break; @@ -72,7 +73,7 @@ public class GiveAllCommand implements CommandHandler { Collection genshinItemList =new LinkedList<>(); for (ItemData itemdata: GenshinData.getItemDataMap().values()) { - if(itemdata.getId() > 1000 && itemdata.getId() <= 1099) continue; + if(itemdata.getId() > 1000 && itemdata.getId() <= 1099)continue;//is avatar if (itemdata.isEquip()) { for (int i = 0; i < 20; i++) { genshinItemList.add(new GenshinItem(itemdata)); @@ -85,14 +86,22 @@ public class GiveAllCommand implements CommandHandler { } player.getInventory().addItems(genshinItemList); - for(AvatarData avatarData:GenshinData.getAvatarDataMap().values()) { + for(AvatarData avatarData:GenshinData.getAvatarDataMap().values()) + { + int ascension; + int level = 90; // Calculate ascension level. - int ascension = (int) Math.ceil(90 / 10f) - 3; + if (level <= 40) { + ascension = (int) Math.ceil(90 / 20f); + } else { + ascension = (int) Math.ceil(90 / 10f) - 3; + } + GenshinAvatar avatar = new GenshinAvatar(avatarData); - avatar.setLevel(90); + avatar.setLevel(level); avatar.setPromoteLevel(ascension); for (int i = 1;i<=6;i++){ - avatar.getTalentIdList().add((avatar.getAvatarId()-10000000)*10+i); + avatar.getTalentIdList().add((avatar.getAvatarId()-10000000)*10+i);//(10000058-10000000)*10+i } // This will handle stats and talents avatar.recalcStats();