aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ExperienceCommand.cpp
blob: 9a59d71a0e1e084dd9e2821107878a3355890a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "stdafx.h"
#include "net.minecraft.commands.h"
#include "..\Minecraft.Client\MinecraftServer.h"
#include "..\Minecraft.Client\PlayerList.h"
#include "net.minecraft.world.level.h"
#include "ExperienceCommand.h"

EGameCommand ExperienceCommand::getId()
{
	return eGameCommand_Experience;
}

int ExperienceCommand::getPermissionLevel()
{
	return LEVEL_GAMEMASTERS;
}

void ExperienceCommand::execute(shared_ptr<CommandSender> source, byteArray commandData)
{
//	if (args.length > 0) {
//		Player player;
//		String inputAmount = args[0];
//
//		boolean levels = inputAmount.endsWith("l") || inputAmount.endsWith("L");
//		if (levels && inputAmount.length() > 1) inputAmount = inputAmount.substring(0, inputAmount.length() - 1);
//
//		int amount = convertArgToInt(source, inputAmount);
//		boolean take = amount < 0;
//
//		if (take) amount *= -1;
//
//		if (args.length > 1) {
//			player = convertToPlayer(source, args[1]);
//		} else {
//			player = convertSourceToPlayer(source);
//		}
//
//		if (levels) {
//			if (take) {
//				player.giveExperienceLevels(-amount);
//				logAdminAction(source, "commands.xp.success.negative.levels", amount, player.getAName());
//			} else {
//				player.giveExperienceLevels(amount);
//				logAdminAction(source, "commands.xp.success.levels", amount, player.getAName());
//			}
//		} else {
//			if (take) {
//				throw new UsageException("commands.xp.failure.widthdrawXp");
//			} else {
//				player.increaseXp(amount);
//				logAdminAction(source, "commands.xp.success", amount, player.getAName());
//			}
//		}
//
//		return;
//	}
//
//	throw new UsageException("commands.xp.usage");
}