This commit is contained in:
BaiSugar 2022-04-24 22:49:33 +08:00
parent 1132c2c753
commit 05c6b29831

View File

@ -21,7 +21,7 @@ public class GiveAllCommand implements CommandHandler {
int target,amount=99999; int target,amount=99999;
switch (args.size()) { switch (args.size()) {
default: // giveall *no args* default: // *no args*
try { try {
target = sender.getUid(); target = sender.getUid();
}catch (NullPointerException ignored){ }catch (NullPointerException ignored){
@ -29,7 +29,7 @@ public class GiveAllCommand implements CommandHandler {
return; return;
} }
break; break;
case 1: //[player] case 1: // [player]
try { try {
target = Integer.parseInt(args.get(0)); target = Integer.parseInt(args.get(0));
if (Grasscutter.getGameServer().getPlayerByUid(target) == null) { if (Grasscutter.getGameServer().getPlayerByUid(target) == null) {
@ -37,11 +37,11 @@ public class GiveAllCommand implements CommandHandler {
return; return;
} }
}catch (NumberFormatException ignored){ }catch (NumberFormatException ignored){
CommandHandler.sendMessage(sender, "Invalid amount or player ID."); CommandHandler.sendMessage(sender, "Invalid player ID.");
return; return;
} }
break; break;
case 2: //[player] [amount] case 2: // [player] [amount]
try { try {
target = Integer.parseInt(args.get(0)); target = Integer.parseInt(args.get(0));
if (Grasscutter.getGameServer().getPlayerByUid(target) == null && sender != null) { if (Grasscutter.getGameServer().getPlayerByUid(target) == null && sender != null) {
@ -85,19 +85,11 @@ public class GiveAllCommand implements CommandHandler {
} }
player.getInventory().addItems(genshinItemList); player.getInventory().addItems(genshinItemList);
for(AvatarData avatarData:GenshinData.getAvatarDataMap().values()) for(AvatarData avatarData:GenshinData.getAvatarDataMap().values()) {
{
int ascension;
int level = 90;
// Calculate ascension level. // Calculate ascension level.
if (level <= 40) { int ascension = (int) Math.ceil(90 / 10f) - 3;
ascension = (int) Math.ceil(90 / 20f);
} else {
ascension = (int) Math.ceil(90 / 10f) - 3;
}
GenshinAvatar avatar = new GenshinAvatar(avatarData); GenshinAvatar avatar = new GenshinAvatar(avatarData);
avatar.setLevel(level); avatar.setLevel(90);
avatar.setPromoteLevel(ascension); avatar.setPromoteLevel(ascension);
for (int i = 1;i<=6;i++){ for (int i = 1;i<=6;i++){
avatar.getTalentIdList().add((avatar.getAvatarId()-10000000)*10+i);//(10000058-10000000)*10+i avatar.getTalentIdList().add((avatar.getAvatarId()-10000000)*10+i);//(10000058-10000000)*10+i