ru.whoisamyy.api.gd.commands.RateCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Geometry Dash kernel in java
package ru.whoisamyy.api.gd.commands;
import ru.whoisamyy.api.gd.objects.Account;
import ru.whoisamyy.api.gd.objects.Level;
import ru.whoisamyy.api.plugins.annotations.CommandHandler;
import ru.whoisamyy.api.plugins.commands.AbstractCommentCommand;
import ru.whoisamyy.api.plugins.commands.CommandArgument;
import ru.whoisamyy.api.utils.enums.DemonDifficulty;
import ru.whoisamyy.api.utils.enums.LevelDifficulty;
import ru.whoisamyy.api.utils.enums.ModType;
@CommandHandler
public class RateCommand extends AbstractCommentCommand {
@CommandHandler(commandName = "rate")
@Override
public void execute(CommandArgument args) {
Account acc = Account.map(args.getInt("senderID"), true);
if (acc.getMod()== ModType.ELDER) {
if (args.getBoolean("demon")) {
Level.rateLevel(args.getInt("id"), args.getInt("stars"), args.getBoolean("epic"), DemonDifficulty.sequenceNumberToDemonDifficulty(args.getInt("diff")));
} else {
Level.rateLevel(args.getInt("id"), args.getInt("stars"), args.getBoolean("epic"), LevelDifficulty.toLevelDifficulty(args.getInt("diff")));
}
}
logger.info(acc.getUsername() + " rated (or at least tried to) level with name " + Level.map(args.getInt("id")));
}
}