summaryrefslogtreecommitdiffstats
path: root/src/ByteBuffer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2022-01-14 22:07:07 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-16 18:41:46 +0100
commite3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b (patch)
tree0358c326f05d47c0940356d9ca295a372c504903 /src/ByteBuffer.cpp
parentsyntax (diff)
downloadcuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar.gz
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar.bz2
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar.lz
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar.xz
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.tar.zst
cuberite-e3d0874f7d255e1d00cd2fd69b76b9414e8e3b5b.zip
Diffstat (limited to '')
-rw-r--r--src/ByteBuffer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index e75051570..1974e1211 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -487,8 +487,8 @@ bool cByteBuffer::ReadLEInt(int & a_Value)
bool cByteBuffer::ReadXYZPosition64(int & a_BlockX, int & a_BlockY, int & a_BlockZ)
{
CHECK_THREAD
- Int64 Value;
- if (!ReadBEInt64(Value))
+ UInt64 Value;
+ if (!ReadBEUInt64(Value))
{
return false;
}
@@ -512,8 +512,8 @@ bool cByteBuffer::ReadXYZPosition64(int & a_BlockX, int & a_BlockY, int & a_Bloc
bool cByteBuffer::ReadXZYPosition64(int & a_BlockX, int & a_BlockY, int & a_BlockZ)
{
CHECK_THREAD
- Int64 Value;
- if (!ReadBEInt64(Value))
+ UInt64 Value;
+ if (!ReadBEUInt64(Value))
{
return false;
}
@@ -771,10 +771,10 @@ bool cByteBuffer::WriteXYZPosition64(Int32 a_BlockX, Int32 a_BlockY, Int32 a_Blo
{
CHECK_THREAD
CheckValid();
- return WriteBEInt64(
- (static_cast<Int64>(a_BlockX & 0x3FFFFFF) << 38) |
- (static_cast<Int64>(a_BlockY & 0xFFF) << 26) |
- (static_cast<Int64>(a_BlockZ & 0x3FFFFFF))
+ return WriteBEUInt64(
+ ((static_cast<UInt64>(a_BlockX) & 0x3FFFFFF) << 38) |
+ ((static_cast<UInt64>(a_BlockY) & 0xFFF) << 26) |
+ (static_cast<UInt64>(a_BlockZ) & 0x3FFFFFF)
);
}
@@ -786,10 +786,10 @@ bool cByteBuffer::WriteXZYPosition64(Int32 a_BlockX, Int32 a_BlockY, Int32 a_Blo
{
CHECK_THREAD
CheckValid();
- return WriteBEInt64(
- (static_cast<Int64>(a_BlockX & 0x3FFFFFF) << 38) |
- (static_cast<Int64>(a_BlockZ & 0x3FFFFFF) << 12) |
- (static_cast<Int64>(a_BlockY & 0xFFF))
+ return WriteBEUInt64(
+ ((static_cast<UInt64>(a_BlockX) & 0x3FFFFFF) << 38) |
+ ((static_cast<UInt64>(a_BlockZ) & 0x3FFFFFF) << 12) |
+ (static_cast<UInt64>(a_BlockY) & 0xFFF)
);
}