the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.commands.h"
3#include "..\Minecraft.Client\MinecraftServer.h"
4#include "..\Minecraft.Client\PlayerList.h"
5#include "..\Minecraft.Client\ServerPlayer.h"
6#include "Command.h"
7
8AdminLogCommand *Command::logger;
9
10int Command::getPermissionLevel()
11{
12 return LEVEL_OWNERS;
13}
14
15bool Command::canExecute(shared_ptr<CommandSender> source)
16{
17 return source->hasPermission(getId());
18}
19
20void Command::logAdminAction(shared_ptr<CommandSender> source, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage)
21{
22 logAdminAction(source, 0, messageType, message, customData, additionalMessage);
23}
24
25void Command::logAdminAction(shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage)
26{
27 if (logger != NULL)
28 {
29 logger->logAdminCommand(source, type, messageType, message, customData, additionalMessage);
30 }
31}
32
33void Command::setLogger(AdminLogCommand *logger)
34{
35 Command::logger = logger;
36}
37
38shared_ptr<ServerPlayer> Command::getPlayer(PlayerUID playerId)
39{
40 shared_ptr<ServerPlayer> player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId);
41
42 if (player == NULL)
43 {
44 return nullptr;
45 }
46 else
47 {
48 return player;
49 }
50}