Search in sources :

Example 1 with Echeladder

use of com.mraof.minestuck.util.Echeladder in project Minestuck by mraof.

the class CommandSetRung method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    if (args.length < 2)
        throw new WrongUsageException(this.getUsage(sender));
    PlayerIdentifier target = IdentifierHandler.getForCommand(server, sender, args[0]);
    int rung = parseInt(args[1], 0, Echeladder.RUNG_COUNT - 1);
    double progress = 0;
    if (args.length >= 3)
        progress = parseDouble(args[2], 0, 1);
    Echeladder echeladder = MinestuckPlayerData.getData(target).echeladder;
    echeladder.setByCommand(rung, progress);
    notifyCommandListener(sender, this, "commands.setRung.success", target.getUsername(), rung, progress * 100);
}
Also used : WrongUsageException(net.minecraft.command.WrongUsageException) PlayerIdentifier(com.mraof.minestuck.util.IdentifierHandler.PlayerIdentifier) Echeladder(com.mraof.minestuck.util.Echeladder)

Aggregations

Echeladder (com.mraof.minestuck.util.Echeladder)1 PlayerIdentifier (com.mraof.minestuck.util.IdentifierHandler.PlayerIdentifier)1 WrongUsageException (net.minecraft.command.WrongUsageException)1