aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/CommandBlockEntity.h
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
commit42aec6dac53dffa6afe072560a7e1d4986112538 (patch)
tree0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.World/CommandBlockEntity.h
parentc9d58eeac7c72f0b3038e084667b4d89a6249fce (diff)
parentef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff)
Merge branch 'main' into pr/win64-world-saves
# Conflicts: # Minecraft.Client/MinecraftServer.cpp # README.md
Diffstat (limited to 'Minecraft.World/CommandBlockEntity.h')
-rw-r--r--Minecraft.World/CommandBlockEntity.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/Minecraft.World/CommandBlockEntity.h b/Minecraft.World/CommandBlockEntity.h
new file mode 100644
index 00000000..3a3c10b6
--- /dev/null
+++ b/Minecraft.World/CommandBlockEntity.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "TileEntity.h"
+#include "CommandSender.h"
+
+class ChatMessageComponent;
+
+class CommandBlockEntity : public TileEntity, public CommandSender
+{
+public:
+ eINSTANCEOF GetType() { return eTYPE_COMMANDBLOCKTILEENTITY; }
+ static TileEntity *create() { return new CommandBlockEntity(); }
+
+ // 4J Added
+ virtual shared_ptr<TileEntity> clone();
+
+private:
+ int successCount;
+ wstring command;
+ wstring name;
+
+public:
+ CommandBlockEntity();
+
+ void setCommand(const wstring &command);
+ wstring getCommand();
+ int performCommand(Level *level);
+ wstring getName();
+ void setName(const wstring &name);
+ virtual void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"");
+ virtual bool hasPermission(EGameCommand command);
+ //void sendMessage(ChatMessageComponent *message);
+ //bool hasPermission(int permissionLevel, const wstring &commandName);
+ void save(CompoundTag *tag);
+ void load(CompoundTag *tag);
+ Pos *getCommandSenderWorldPosition();
+ Level *getCommandSenderWorld();
+ shared_ptr<Packet> getUpdatePacket();
+ int getSuccessCount();
+ void setSuccessCount(int successCount);
+}; \ No newline at end of file