diff options
author | Ash <ash@heyquark.com> | 2024-11-03 16:33:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-03 16:33:40 +0100 |
commit | d82a6afd9e8be53d60043c8ab49223ac9470ad46 (patch) | |
tree | 6ef640f49754abdde3b541b2e756feffa3ccab05 /src/WorldStorage/FastNBT.h | |
parent | Make biomal composition gen respect the shapegen when placing bedrock (#5579) (diff) | |
download | cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar.gz cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar.bz2 cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar.lz cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar.xz cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.tar.zst cuberite-d82a6afd9e8be53d60043c8ab49223ac9470ad46.zip |
Diffstat (limited to 'src/WorldStorage/FastNBT.h')
-rw-r--r-- | src/WorldStorage/FastNBT.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/WorldStorage/FastNBT.h b/src/WorldStorage/FastNBT.h index d9c388179..b2eb851d7 100644 --- a/src/WorldStorage/FastNBT.h +++ b/src/WorldStorage/FastNBT.h @@ -227,21 +227,21 @@ public: inline Int16 GetShort(int a_Tag) const { ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Short); - return GetBEShort(GetData(a_Tag)); + return NetworkBufToHost<Int16>(GetData(a_Tag)); } /** Returns the value stored in an Int tag. Not valid for any other tag type. */ inline Int32 GetInt(int a_Tag) const { ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Int); - return GetBEInt(GetData(a_Tag)); + return NetworkBufToHost<Int32>(GetData(a_Tag)); } /** Returns the value stored in a Long tag. Not valid for any other tag type. */ inline Int64 GetLong(int a_Tag) const { ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Long); - return NetworkToHostLong8(GetData(a_Tag)); + return NetworkBufToHost<Int64>(GetData(a_Tag)); } /** Returns the value stored in a Float tag. Not valid for any other tag type. */ @@ -256,10 +256,7 @@ public: UNUSED_VAR(Check1); UNUSED_VAR(Check2); - Int32 i = GetBEInt(GetData(a_Tag)); - float f; - memcpy(&f, &i, sizeof(f)); - return f; + return NetworkBufToHost<float>(GetData(a_Tag)); } /** Returns the value stored in a Double tag. Not valid for any other tag type. */ @@ -273,7 +270,7 @@ public: UNUSED_VAR(Check2); ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Double); - return NetworkToHostDouble8(GetData(a_Tag)); + return NetworkBufToHost<double>(GetData(a_Tag)); } /** Returns the value stored in a String tag. Not valid for any other tag type. */ |