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 "CommandDispatcher.h"
4
5int CommandDispatcher::performCommand(shared_ptr<CommandSender> sender, EGameCommand command, byteArray commandData)
6{
7 AUTO_VAR(it, commandsById.find(command));
8
9 if(it != commandsById.end())
10 {
11 Command *command = it->second;
12 if (command->canExecute(sender))
13 {
14 command->execute(sender, commandData);
15 }
16 else
17 {
18#ifndef _CONTENT_PACKAGE
19 sender->sendMessage(L"\u00A7cYou do not have permission to use this command.");
20#endif
21 }
22 }
23 else
24 {
25 app.DebugPrintf("Command %d not found!\n", command);
26 }
27
28 return 0;
29}
30
31Command *CommandDispatcher::addCommand(Command *command)
32{
33 commandsById[command->getId()] = command;
34 commands.insert(command);
35 return command;
36}