the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 41 lines 1.2 kB view raw
1#pragma once 2 3#include "TileEntity.h" 4#include "CommandSender.h" 5 6class ChatMessageComponent; 7 8class CommandBlockEntity : public TileEntity, public CommandSender 9{ 10public: 11 eINSTANCEOF GetType() { return eTYPE_COMMANDBLOCKTILEENTITY; } 12 static TileEntity *create() { return new CommandBlockEntity(); } 13 14 // 4J Added 15 virtual shared_ptr<TileEntity> clone(); 16 17private: 18 int successCount; 19 wstring command; 20 wstring name; 21 22public: 23 CommandBlockEntity(); 24 25 void setCommand(const wstring &command); 26 wstring getCommand(); 27 int performCommand(Level *level); 28 wstring getName(); 29 void setName(const wstring &name); 30 virtual void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L""); 31 virtual bool hasPermission(EGameCommand command); 32 //void sendMessage(ChatMessageComponent *message); 33 //bool hasPermission(int permissionLevel, const wstring &commandName); 34 void save(CompoundTag *tag); 35 void load(CompoundTag *tag); 36 Pos *getCommandSenderWorldPosition(); 37 Level *getCommandSenderWorld(); 38 shared_ptr<Packet> getUpdatePacket(); 39 int getSuccessCount(); 40 void setSuccessCount(int successCount); 41};