From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/SynchedEntityData.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Minecraft.World/SynchedEntityData.h') diff --git a/Minecraft.World/SynchedEntityData.h b/Minecraft.World/SynchedEntityData.h index e79a10b8..69d0f248 100644 --- a/Minecraft.World/SynchedEntityData.h +++ b/Minecraft.World/SynchedEntityData.h @@ -15,9 +15,12 @@ public: const int id; // 4J - there used to be one "value" type here of general type Object, just storing the different (used) varieties // here separately for us - byte value_byte; - int value_int; - short value_short; + union { + byte value_byte; + int value_int; + short value_short; + float value_float; + }; wstring value_wstring; shared_ptr value_itemInstance; bool dirty; @@ -29,16 +32,19 @@ public: DataItem(int type, int id, const wstring& value); DataItem(int type, int id, shared_ptr itemInstance); DataItem(int type, int id, short value); + DataItem(int type, int id, float value); int getId(); void setValue(byte value); void setValue(int value); void setValue(short value); + void setValue(float value); void setValue(const wstring& value); void setValue(shared_ptr value); byte getValue_byte(); int getValue_int(); short getValue_short(); + float getValue_float(); wstring getValue_wstring(); shared_ptr getValue_itemInstance(); int getType(); @@ -50,7 +56,6 @@ public: static const int MAX_STRING_DATA_LENGTH = 64; static const int EOF_MARKER = 0x7f; -private: static const int TYPE_BYTE = 0; static const int TYPE_SHORT = 1; static const int TYPE_INT = 2; @@ -71,7 +76,7 @@ private: // the id value must fit in the remaining bits static const int MAX_ID_VALUE = ~TYPE_MASK & 0xff; - unordered_map > itemsById; + shared_ptr itemsById[MAX_ID_VALUE+1]; bool m_isDirty; public: @@ -83,6 +88,7 @@ public: void define(int id, const wstring& value); void define(int id, int value); void define(int id, short value); + void define(int id, float value); void defineNULL(int id, void *pVal); void checkId(int id); // 4J - added to contain common code from overloaded define functions above @@ -97,6 +103,7 @@ public: void set(int id, byte value); void set(int id, int value); void set(int id, short value); + void set(int id, float value); void set(int id, const wstring& value); void set(int id, shared_ptr); void markDirty(int id); @@ -121,6 +128,7 @@ public: public: void assignValues(vector > *items); bool isEmpty(); + void clearDirty(); // 4J Added int getSizeInBytes(); -- cgit v1.2.3