From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/ItemFrame.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Minecraft.World/ItemFrame.h (limited to 'Minecraft.World/ItemFrame.h') diff --git a/Minecraft.World/ItemFrame.h b/Minecraft.World/ItemFrame.h new file mode 100644 index 00000000..1af5c2e9 --- /dev/null +++ b/Minecraft.World/ItemFrame.h @@ -0,0 +1,41 @@ +#pragma once +using namespace std; +#include "Entity.h" +#include "HangingEntity.h" + +class Level; + +class ItemFrame : public HangingEntity +{ +public: + eINSTANCEOF GetType() { return eTYPE_ITEM_FRAME; }; + static Entity *create(Level *level) { return new ItemFrame(level); } +private: + static const int DATA_ITEM = 2; + static const int DATA_ROTATION = 3; + +private: + + void _init(); + +public: + ItemFrame(Level *level); + ItemFrame(Level *level, int xTile, int yTile, int zTile, int dir); + +protected: + virtual void defineSynchedData(); + virtual int getWidth() {return 9;} + virtual int getHeight() {return 9;} + virtual void dropItem(); + +public: + + shared_ptr getItem(); + void setItem(shared_ptr item); + int getRotation(); + void setRotation(int rotation); + + virtual void addAdditonalSaveData(CompoundTag *tag); + virtual void readAdditionalSaveData(CompoundTag *tag); + virtual bool interact(shared_ptr player); +}; \ No newline at end of file -- cgit v1.2.3