add console command headers

This commit is contained in:
murdle 2026-01-20 19:17:30 +02:00
parent b5c0ea3efe
commit 5f1f727878
5 changed files with 81 additions and 2 deletions

View File

@ -0,0 +1,22 @@
#pragma once
#include "string.h"
class Minecraft;
class CommandOrigin {
};
class DedicatedServerCommandOrigin : public CommandOrigin {
public:
static void (*DedicatedServerCommandOrigin_construct)(DedicatedServerCommandOrigin*, mcpe::string const&, Minecraft&);
char filler[0x1C];
DedicatedServerCommandOrigin(mcpe::string const& s, Minecraft& m) {
DedicatedServerCommandOrigin_construct(this, s, m);
}
};

15
mcpe/Minecraft.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
class MinecraftCommands;
class Minecraft {
public:
static MinecraftCommands* (*Minecraft_getCommands)(Minecraft*);
MinecraftCommands* getCommands() {
return Minecraft_getCommands(this);
}
};

28
mcpe/MinecraftCommands.h Normal file
View File

@ -0,0 +1,28 @@
#pragma once
#include <memory>
#include "string.h"
class CommandOrigin;
enum class MCCATEGORY {
//
};
struct MCRESULT {
bool success;
MCCATEGORY category;
unsigned short code;
};
class MinecraftCommands {
public:
static MCRESULT (*MinecraftCommands_requestCommandExecution)(MinecraftCommands*, std::unique_ptr<CommandOrigin>, mcpe::string const&, mcpe::string&);
MCRESULT requestCommandExecution(std::unique_ptr<CommandOrigin> o, mcpe::string const& s, mcpe::string& s2) {
return MinecraftCommands_requestCommandExecution(this, std::move(o), s, s2);
}
};

View File

@ -24,7 +24,9 @@ class ResourcePackManager;
class ServerInstance { class ServerInstance {
public: public:
char filler[0x300]; char filler[0xC];
Minecraft* minecraft;
char filler2[0x300];
static void (*ServerInstance_construct)( static void (*ServerInstance_construct)(
ServerInstance*, ServerInstance*,

View File

@ -136,4 +136,16 @@ void** ResourcePackStack::vtable_sym;
#include "Scheduler.h" #include "Scheduler.h"
Scheduler* (*Scheduler::singleton)(); Scheduler* (*Scheduler::singleton)();
void (*Scheduler::Scheduler_processCoroutines)(Scheduler*, std::chrono::duration<long long>); void (*Scheduler::Scheduler_processCoroutines)(Scheduler*, std::chrono::duration<long long>);
#include "Minecraft.h"
MinecraftCommands* (*Minecraft::Minecraft_getCommands)(Minecraft*);
#include "MinecraftCommands.h"
MCRESULT (*MinecraftCommands::MinecraftCommands_requestCommandExecution)(MinecraftCommands*, std::unique_ptr<CommandOrigin>, mcpe::string const&, mcpe::string&);
#include "DedicatedServerCommandOrigin.h"
void (*DedicatedServerCommandOrigin::DedicatedServerCommandOrigin_construct)(DedicatedServerCommandOrigin*, mcpe::string const&, Minecraft&);