From 357fca24aadfe787383a6c2852b8a447b7d5455e Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sat, 21 Mar 2026 17:10:36 -0500 Subject: [PATCH] refactor: nuke __int64/__uint64 in Minecraft.World --- Minecraft.World/Blocks/NotGateTile.cpp | 4 ++-- Minecraft.World/Blocks/NotGateTile.h | 6 ++--- Minecraft.World/Blocks/Tile.cpp | 2 +- Minecraft.World/Blocks/Tile.h | 2 +- .../Blocks/TileEntities/BeaconTileEntity.h | 2 +- Minecraft.World/Containers/EnchantmentMenu.h | 2 +- Minecraft.World/Entities/Mobs/LightningBolt.h | 2 +- .../IO/Files/ConsoleSaveFileInputStream.h | 2 +- .../IO/Files/ConsoleSaveFileOriginal.cpp | 2 +- .../IO/Files/ConsoleSaveFileSplit.cpp | 4 ++-- Minecraft.World/IO/Files/File.cpp | 12 +++++----- Minecraft.World/IO/Files/File.h | 4 ++-- Minecraft.World/IO/Files/FileHeader.h | 2 +- Minecraft.World/IO/Files/FileInputStream.cpp | 16 ++++++------- Minecraft.World/IO/Files/FileInputStream.h | 2 +- Minecraft.World/IO/NBT/CompoundTag.h | 6 ++--- Minecraft.World/IO/NBT/LongTag.h | 4 ++-- Minecraft.World/IO/NBT/NbtSlotFile.cpp | 4 ++-- Minecraft.World/IO/NBT/NbtSlotFile.h | 2 +- .../IO/Streams/ByteArrayInputStream.cpp | 2 +- .../IO/Streams/ByteArrayInputStream.h | 2 +- Minecraft.World/IO/Streams/ByteBuffer.cpp | 22 ++++++++--------- Minecraft.World/IO/Streams/ByteBuffer.h | 4 ++-- Minecraft.World/IO/Streams/DataInput.h | 2 +- .../IO/Streams/DataInputStream.cpp | 24 +++++++++---------- Minecraft.World/IO/Streams/DataInputStream.h | 4 ++-- Minecraft.World/IO/Streams/DataOutput.h | 2 +- .../IO/Streams/DataOutputStream.cpp | 4 ++-- Minecraft.World/IO/Streams/DataOutputStream.h | 2 +- Minecraft.World/IO/Streams/GZIPInputStream.h | 2 +- Minecraft.World/IO/Streams/InputStream.h | 2 +- Minecraft.World/Level/Level.cpp | 2 +- Minecraft.World/Level/RandomLevelSource.cpp | 4 ++-- .../Level/Storage/McRegionChunkStorage.cpp | 4 ++-- .../Level/Storage/McRegionChunkStorage.h | 2 +- .../Level/Storage/OldChunkStorage.cpp | 4 ++-- .../Network/Packets/LoginPacket.cpp | 4 ++-- Minecraft.World/Network/Packets/LoginPacket.h | 4 ++-- Minecraft.World/Network/Packets/Packet.cpp | 6 ++--- Minecraft.World/Network/Packets/Packet.h | 12 +++++----- .../Network/Packets/RespawnPacket.cpp | 2 +- .../Network/Packets/RespawnPacket.h | 4 ++-- .../Network/Packets/SetTimePacket.cpp | 2 +- .../Network/Packets/SetTimePacket.h | 4 ++-- Minecraft.World/Network/Socket.h | 4 ++-- Minecraft.World/Platform/System.cpp | 16 ++++++------- Minecraft.World/Platform/System.h | 8 +++---- Minecraft.World/Platform/stdafx.h | 2 +- Minecraft.World/Util/BasicTypeContainers.h | 4 ++-- Minecraft.World/Util/C4JThread.h | 2 +- Minecraft.World/Util/JavaIntHash.h | 6 ++--- Minecraft.World/Util/JavaMath.cpp | 2 +- Minecraft.World/Util/JavaMath.h | 2 +- Minecraft.World/Util/Language.cpp | 2 +- Minecraft.World/Util/Mth.cpp | 4 ++-- Minecraft.World/Util/Mth.h | 2 +- Minecraft.World/Util/PortableFileIO.h | 10 ++++---- Minecraft.World/Util/Random.cpp | 12 +++++----- Minecraft.World/Util/Random.h | 8 +++---- .../WorldGen/Biomes/BiomeCache.cpp | 14 +++++------ Minecraft.World/WorldGen/Biomes/BiomeCache.h | 6 ++--- .../WorldGen/Biomes/BiomeSource.cpp | 12 +++++----- Minecraft.World/WorldGen/Biomes/BiomeSource.h | 8 +++---- .../WorldGen/Features/BasicTreeFeature.cpp | 2 +- .../WorldGen/Features/CanyonFeature.cpp | 2 +- .../WorldGen/Features/CanyonFeature.h | 2 +- .../WorldGen/Features/CaveFeature.cpp | 2 +- .../WorldGen/Features/LargeCaveFeature.cpp | 4 ++-- .../WorldGen/Features/LargeCaveFeature.h | 4 ++-- .../WorldGen/Features/LargeFeature.cpp | 4 ++-- .../WorldGen/Features/StructureFeature.cpp | 8 +++---- .../WorldGen/Features/StructureFeature.h | 2 +- .../WorldGen/Layers/AddIslandLayer.cpp | 2 +- .../WorldGen/Layers/AddIslandLayer.h | 2 +- .../Layers/AddMushroomIslandLayer.cpp | 2 +- .../WorldGen/Layers/AddMushroomIslandLayer.h | 2 +- .../WorldGen/Layers/AddSnowLayer.cpp | 2 +- .../WorldGen/Layers/AddSnowLayer.h | 2 +- .../WorldGen/Layers/BiomeInitLayer.cpp | 2 +- .../WorldGen/Layers/BiomeInitLayer.h | 2 +- .../WorldGen/Layers/FuzzyZoomLayer.cpp | 4 ++-- .../WorldGen/Layers/FuzzyZoomLayer.h | 4 ++-- .../Layers/GrowMushroomIslandLayer.cpp | 2 +- .../WorldGen/Layers/GrowMushroomIslandLayer.h | 2 +- .../WorldGen/Layers/IslandLayer.cpp | 2 +- Minecraft.World/WorldGen/Layers/IslandLayer.h | 2 +- Minecraft.World/WorldGen/Layers/Layer.cpp | 8 +++---- Minecraft.World/WorldGen/Layers/Layer.h | 14 +++++------ .../WorldGen/Layers/RegionHillsLayer.cpp | 2 +- .../WorldGen/Layers/RegionHillsLayer.h | 2 +- .../WorldGen/Layers/RiverInitLayer.cpp | 2 +- .../WorldGen/Layers/RiverInitLayer.h | 2 +- .../WorldGen/Layers/RiverLayer.cpp | 2 +- Minecraft.World/WorldGen/Layers/RiverLayer.h | 2 +- .../WorldGen/Layers/RiverMixerLayer.cpp | 4 ++-- .../WorldGen/Layers/RiverMixerLayer.h | 4 ++-- .../WorldGen/Layers/ShoreLayer.cpp | 2 +- Minecraft.World/WorldGen/Layers/ShoreLayer.h | 2 +- .../WorldGen/Layers/SmoothLayer.cpp | 2 +- Minecraft.World/WorldGen/Layers/SmoothLayer.h | 2 +- .../WorldGen/Layers/SmoothZoomLayer.cpp | 4 ++-- .../WorldGen/Layers/SmoothZoomLayer.h | 4 ++-- .../WorldGen/Layers/SwampRiversLayer.cpp | 2 +- .../WorldGen/Layers/SwampRiversLayer.h | 2 +- .../WorldGen/Layers/VoronoiZoom.cpp | 2 +- Minecraft.World/WorldGen/Layers/VoronoiZoom.h | 2 +- Minecraft.World/WorldGen/Layers/ZoomLayer.cpp | 4 ++-- Minecraft.World/WorldGen/Layers/ZoomLayer.h | 4 ++-- .../WorldGen/Noise/PerlinNoise.cpp | 4 ++-- .../WorldGen/Sources/FlatLevelSource.cpp | 6 ++--- .../WorldGen/Sources/FlatLevelSource.h | 2 +- .../WorldGen/Sources/HellFlatLevelSource.cpp | 6 ++--- .../WorldGen/Sources/HellFlatLevelSource.h | 2 +- .../Sources/HellRandomLevelSource.cpp | 6 ++--- .../WorldGen/Sources/HellRandomLevelSource.h | 2 +- .../Sources/TheEndLevelRandomLevelSource.cpp | 6 ++--- .../Sources/TheEndLevelRandomLevelSource.h | 2 +- 117 files changed, 251 insertions(+), 251 deletions(-) diff --git a/Minecraft.World/Blocks/NotGateTile.cpp b/Minecraft.World/Blocks/NotGateTile.cpp index 4d3ab5f7d..a71e12c2b 100644 --- a/Minecraft.World/Blocks/NotGateTile.cpp +++ b/Minecraft.World/Blocks/NotGateTile.cpp @@ -202,8 +202,8 @@ int NotGateTile::cloneTileId(Level* level, int x, int y, int z) { return Tile::redstoneTorch_on_Id; } -void NotGateTile::levelTimeChanged(Level* level, __int64 delta, - __int64 newTime) { +void NotGateTile::levelTimeChanged(Level* level, int64_t delta, + int64_t newTime) { std::deque* toggles = recentToggles[level]; if (toggles != NULL) { diff --git a/Minecraft.World/Blocks/NotGateTile.h b/Minecraft.World/Blocks/NotGateTile.h index 2db622d24..ac378bf8c 100644 --- a/Minecraft.World/Blocks/NotGateTile.h +++ b/Minecraft.World/Blocks/NotGateTile.h @@ -16,9 +16,9 @@ public: class Toggle { public: int x, y, z; - __int64 when; + int64_t when; - Toggle(int x, int y, int z, __int64 when) { + Toggle(int x, int y, int z, int64_t when) { this->x = x; this->y = y; this->z = z; @@ -58,6 +58,6 @@ public: public: void animateTick(Level* level, int xt, int yt, int zt, Random* random); int cloneTileId(Level* level, int x, int y, int z); - void levelTimeChanged(Level* level, __int64 delta, __int64 newTime); + void levelTimeChanged(Level* level, int64_t delta, int64_t newTime); bool isMatching(int id); }; \ No newline at end of file diff --git a/Minecraft.World/Blocks/Tile.cpp b/Minecraft.World/Blocks/Tile.cpp index 76091cdb3..0f5bc9a07 100644 --- a/Minecraft.World/Blocks/Tile.cpp +++ b/Minecraft.World/Blocks/Tile.cpp @@ -2495,7 +2495,7 @@ void Tile::onRemoving(Level* level, int x, int y, int z, int data) {} void Tile::handleRain(Level* level, int x, int y, int z) {} -void Tile::levelTimeChanged(Level* level, __int64 delta, __int64 newTime) {} +void Tile::levelTimeChanged(Level* level, int64_t delta, int64_t newTime) {} bool Tile::useOwnCloneData() { return false; } diff --git a/Minecraft.World/Blocks/Tile.h b/Minecraft.World/Blocks/Tile.h index de191e764..3f347285d 100644 --- a/Minecraft.World/Blocks/Tile.h +++ b/Minecraft.World/Blocks/Tile.h @@ -772,7 +772,7 @@ public: std::shared_ptr player); virtual void onRemoving(Level* level, int x, int y, int z, int data); virtual void handleRain(Level* level, int x, int y, int z); - virtual void levelTimeChanged(Level* level, __int64 delta, __int64 newTime); + virtual void levelTimeChanged(Level* level, int64_t delta, int64_t newTime); virtual bool useOwnCloneData(); virtual bool canInstantlyTick(); virtual bool dropFromExplosion(Explosion* explosion); diff --git a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h b/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h index 7006360f1..64d6af548 100644 --- a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h @@ -21,7 +21,7 @@ public: static void staticCtor(); private: - __int64 clientSideRenderTick; + int64_t clientSideRenderTick; float clientSideRenderScale; bool isActive; diff --git a/Minecraft.World/Containers/EnchantmentMenu.h b/Minecraft.World/Containers/EnchantmentMenu.h index c93c80996..0d189607a 100644 --- a/Minecraft.World/Containers/EnchantmentMenu.h +++ b/Minecraft.World/Containers/EnchantmentMenu.h @@ -22,7 +22,7 @@ private: bool m_costsChanged; // 4J Added public: - __int64 nameSeed; + int64_t nameSeed; public: int costs[3]; diff --git a/Minecraft.World/Entities/Mobs/LightningBolt.h b/Minecraft.World/Entities/Mobs/LightningBolt.h index b80df6268..fabd93144 100644 --- a/Minecraft.World/Entities/Mobs/LightningBolt.h +++ b/Minecraft.World/Entities/Mobs/LightningBolt.h @@ -14,7 +14,7 @@ private: int life; public: - __int64 seed; + int64_t seed; private: int flashes; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h index eb295878a..3203644fd 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h +++ b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h @@ -18,7 +18,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } + virtual int64_t skip(int64_t n) { return n; } private: ConsoleSaveFile* m_saveFile; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index 2abb157aa..bc54c3e07 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -789,7 +789,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) { std::uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata, 88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if (MinecraftServer::getInstance() != NULL && MinecraftServer::getInstance()->levels[0] != NULL) { diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp index 310bcb994..00690c559 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp @@ -966,7 +966,7 @@ void ConsoleSaveFileSplit::tick() { { unsigned int totalDirty = 0; unsigned int totalDirtyBytes = 0; - __int64 oldestDirty = currentTime; + int64_t oldestDirty = currentTime; for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { if (it->second->dirty) { if (it->second->lastWritten < oldestDirty) { @@ -1397,7 +1397,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) { std::uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata, 88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if (MinecraftServer::getInstance() != NULL && MinecraftServer::getInstance()->levels[0] != NULL) { diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/IO/Files/File.cpp index ac38e6f05..fb09c1a4f 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/IO/Files/File.cpp @@ -39,12 +39,12 @@ std::wstring ToFilename(const fs::path& path) { return filenametowstring(filename.c_str()); } -__int64 ToEpochMilliseconds(const fs::file_time_type& fileTime) { +int64_t ToEpochMilliseconds(const fs::file_time_type& fileTime) { using namespace std::chrono; const auto systemTime = time_point_cast( fileTime - fs::file_time_type::clock::now() + system_clock::now()); - return static_cast<__int64>(systemTime.time_since_epoch().count()); + return static_cast(systemTime.time_since_epoch().count()); } } // namespace #endif @@ -638,7 +638,7 @@ bool File::isDirectory() const { // value is unspecified if this pathname denotes a directory. Returns: The // length, in bytes, of the file denoted by this abstract pathname, or 0L if the // file does not exist -__int64 File::length() { +int64_t File::length() { #ifdef __PS3__ // extern const char* getPS3HomePath(); CellFsErrno err = 0; @@ -701,7 +701,7 @@ __int64 File::length() { if (fs::is_regular_file(path, error)) { const auto size = fs::file_size(path, error); if (!error) { - return static_cast<__int64>(size); + return static_cast(size); } } @@ -742,7 +742,7 @@ __int64 File::length() { // modified. Returns: A long value representing the time the file was last // modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, // 1970), or 0L if the file does not exist or if an I/O error occurs -__int64 File::lastModified() { +int64_t File::lastModified() { #if !defined(__PS3__) && !defined(__ORBIS__) && !defined(__PSVITA__) std::error_code error; const fs::path path = ToFilesystemPath(getPath()); @@ -789,7 +789,7 @@ __int64 File::lastModified() { struct stat fileStat; if (stat(wstringtofilename(getPath()), &fileStat) == 0 && !S_ISDIR(fileStat.st_mode)) { - return static_cast<__int64>(fileStat.st_mtime); + return static_cast(fileStat.st_mtime); } else { return 0l; } diff --git a/Minecraft.World/IO/Files/File.h b/Minecraft.World/IO/Files/File.h index ec39b6af2..108dca8d8 100644 --- a/Minecraft.World/IO/Files/File.h +++ b/Minecraft.World/IO/Files/File.h @@ -26,8 +26,8 @@ public: std::vector* listFiles() const; // Array std::vector* listFiles(FileFilter* filter) const; bool isDirectory() const; - __int64 length(); - __int64 lastModified(); + int64_t length(); + int64_t lastModified(); const std::wstring getPath() const; // 4J Jev: TODO std::wstring getName() const; diff --git a/Minecraft.World/IO/Files/FileHeader.h b/Minecraft.World/IO/Files/FileHeader.h index 9f5da6c04..dd1633ba0 100644 --- a/Minecraft.World/IO/Files/FileHeader.h +++ b/Minecraft.World/IO/Files/FileHeader.h @@ -99,7 +99,7 @@ public: unsigned int regionIndex; // 4B }; - __int64 lastModifiedTime; // 8B + int64_t lastModifiedTime; // 8B }; typedef FileEntrySaveDataV2 FileEntrySaveData; diff --git a/Minecraft.World/IO/Files/FileInputStream.cpp b/Minecraft.World/IO/Files/FileInputStream.cpp index 17ca54346..dd494a7b6 100644 --- a/Minecraft.World/IO/Files/FileInputStream.cpp +++ b/Minecraft.World/IO/Files/FileInputStream.cpp @@ -7,15 +7,15 @@ extern CConsoleMinecraftApp app; namespace { -__int64 FileTell(std::FILE* file) { +int64_t FileTell(std::FILE* file) { #if defined(_WIN32) return _ftelli64(file); #else - return static_cast<__int64>(ftello(file)); + return static_cast(ftello(file)); #endif } -bool FileSeek(std::FILE* file, __int64 offset, int origin) { +bool FileSeek(std::FILE* file, int64_t offset, int origin) { #if defined(_WIN32) return _fseeki64(file, offset, origin) == 0; #else @@ -167,12 +167,12 @@ void FileInputStream::close() { // pos and k is returned. Overrides: skip in class InputStream Parameters: n - // the number of bytes to be skipped. Returns: the actual number of bytes // skipped. -__int64 FileInputStream::skip(__int64 n) { +int64_t FileInputStream::skip(int64_t n) { if (m_fileHandle == NULL || n <= 0) { return 0; } - const __int64 start = FileTell(m_fileHandle); + const int64_t start = FileTell(m_fileHandle); if (start < 0) { return 0; } @@ -181,13 +181,13 @@ __int64 FileInputStream::skip(__int64 n) { return 0; } - const __int64 end = FileTell(m_fileHandle); + const int64_t end = FileTell(m_fileHandle); if (end < 0) { return 0; } - const __int64 offset = std::min(n, std::max<__int64>(0, end - start)); - const __int64 target = start + offset; + const int64_t offset = std::min(n, std::max(0, end - start)); + const int64_t target = start + offset; if (!FileSeek(m_fileHandle, target, SEEK_SET)) { return 0; } diff --git a/Minecraft.World/IO/Files/FileInputStream.h b/Minecraft.World/IO/Files/FileInputStream.h index 2ec91391f..7d3d3eed7 100644 --- a/Minecraft.World/IO/Files/FileInputStream.h +++ b/Minecraft.World/IO/Files/FileInputStream.h @@ -15,7 +15,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); private: std::FILE* m_fileHandle; diff --git a/Minecraft.World/IO/NBT/CompoundTag.h b/Minecraft.World/IO/NBT/CompoundTag.h index a2d4ec695..bc3e0bf6a 100644 --- a/Minecraft.World/IO/NBT/CompoundTag.h +++ b/Minecraft.World/IO/NBT/CompoundTag.h @@ -68,7 +68,7 @@ public: tags[name] = (new IntTag(name, value)); } - void putLong(const wchar_t* name, __int64 value) { + void putLong(const wchar_t* name, int64_t value) { tags[name] = (new LongTag(name, value)); } @@ -124,8 +124,8 @@ public: return ((IntTag*)tags[name])->data; } - __int64 getLong(const wchar_t* name) { - if (tags.find(name) == tags.end()) return (__int64)0; + int64_t getLong(const wchar_t* name) { + if (tags.find(name) == tags.end()) return (int64_t)0; return ((LongTag*)tags[name])->data; } diff --git a/Minecraft.World/IO/NBT/LongTag.h b/Minecraft.World/IO/NBT/LongTag.h index 5e6e82c38..810e52946 100644 --- a/Minecraft.World/IO/NBT/LongTag.h +++ b/Minecraft.World/IO/NBT/LongTag.h @@ -3,9 +3,9 @@ class LongTag : public Tag { public: - __int64 data; + int64_t data; LongTag(const std::wstring& name) : Tag(name) {} - LongTag(const std::wstring& name, __int64 data) : Tag(name) { + LongTag(const std::wstring& name, int64_t data) : Tag(name) { this->data = data; } diff --git a/Minecraft.World/IO/NBT/NbtSlotFile.cpp b/Minecraft.World/IO/NBT/NbtSlotFile.cpp index 6b80cc188..ce4d42f84 100644 --- a/Minecraft.World/IO/NBT/NbtSlotFile.cpp +++ b/Minecraft.World/IO/NBT/NbtSlotFile.cpp @@ -19,7 +19,7 @@ std::FILE* OpenBinaryFileForReadWrite(const File& file) { return stream; } -bool SeekFile(std::FILE* file, __int64 offset) { +bool SeekFile(std::FILE* file, int64_t offset) { #if defined(_WIN32) return _fseeki64(file, offset, SEEK_SET) == 0; #else @@ -37,7 +37,7 @@ bool WriteExact(std::FILE* file, const void* buffer, std::size_t size) { } // namespace byteArray NbtSlotFile::READ_BUFFER(1024 * 1024); -__int64 NbtSlotFile::largest = 0; +int64_t NbtSlotFile::largest = 0; NbtSlotFile::NbtSlotFile(File file) { totalFileSlots = 0; diff --git a/Minecraft.World/IO/NBT/NbtSlotFile.h b/Minecraft.World/IO/NBT/NbtSlotFile.h index cf128f4a5..9f7a88788 100644 --- a/Minecraft.World/IO/NBT/NbtSlotFile.h +++ b/Minecraft.World/IO/NBT/NbtSlotFile.h @@ -20,7 +20,7 @@ private: int fileSlotMapLength; std::vector freeFileSlots; int totalFileSlots; - static __int64 largest; + static int64_t largest; public: NbtSlotFile(File file); diff --git a/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp b/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp index 18bc5b1f3..adcf9fc30 100644 --- a/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp +++ b/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp @@ -95,7 +95,7 @@ void ByteArrayInputStream::close() { return; } // pos and k is returned. Overrides: skip in class InputStream Parameters: n - // the number of bytes to be skipped. Returns: the actual number of bytes // skipped. -__int64 ByteArrayInputStream::skip(__int64 n) { +int64_t ByteArrayInputStream::skip(int64_t n) { int newPos = pos + n; if (newPos > count) newPos = count; diff --git a/Minecraft.World/IO/Streams/ByteArrayInputStream.h b/Minecraft.World/IO/Streams/ByteArrayInputStream.h index 7c09c99f6..290cef2db 100644 --- a/Minecraft.World/IO/Streams/ByteArrayInputStream.h +++ b/Minecraft.World/IO/Streams/ByteArrayInputStream.h @@ -22,7 +22,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); // 4J Stu Added - Sometimes we don't want to delete the data on destroying // this diff --git a/Minecraft.World/IO/Streams/ByteBuffer.cpp b/Minecraft.World/IO/Streams/ByteBuffer.cpp index 09076fbca..a9c842735 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.cpp +++ b/Minecraft.World/IO/Streams/ByteBuffer.cpp @@ -161,19 +161,19 @@ int ByteBuffer::getInt(unsigned int index) { // // Returns: // The long value at the buffer's current position -__int64 ByteBuffer::getLong() { +int64_t ByteBuffer::getLong() { assert(m_position + 8 < m_limit); - __int64 value = 0; + int64_t value = 0; - __int64 b1 = static_cast<__int64>(buffer[m_position]); - __int64 b2 = static_cast<__int64>(buffer[m_position + 1]); - __int64 b3 = static_cast<__int64>(buffer[m_position + 2]); - __int64 b4 = static_cast<__int64>(buffer[m_position + 3]); - __int64 b5 = static_cast<__int64>(buffer[m_position + 4]); - __int64 b6 = static_cast<__int64>(buffer[m_position + 5]); - __int64 b7 = static_cast<__int64>(buffer[m_position + 6]); - __int64 b8 = static_cast<__int64>(buffer[m_position + 7]); + int64_t b1 = static_cast(buffer[m_position]); + int64_t b2 = static_cast(buffer[m_position + 1]); + int64_t b3 = static_cast(buffer[m_position + 2]); + int64_t b4 = static_cast(buffer[m_position + 3]); + int64_t b5 = static_cast(buffer[m_position + 4]); + int64_t b6 = static_cast(buffer[m_position + 5]); + int64_t b7 = static_cast(buffer[m_position + 6]); + int64_t b8 = static_cast(buffer[m_position + 7]); m_position += 8; @@ -341,7 +341,7 @@ ByteBuffer* ByteBuffer::putShortArray(shortArray& s) { // value - The long value to be written // Returns: // This buffer -ByteBuffer* ByteBuffer::putLong(__int64 value) { +ByteBuffer* ByteBuffer::putLong(int64_t value) { assert(m_position + 7 < m_limit); if (byteOrder == BIGENDIAN) { diff --git a/Minecraft.World/IO/Streams/ByteBuffer.h b/Minecraft.World/IO/Streams/ByteBuffer.h index 336eb7688..7b7cc6626 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.h +++ b/Minecraft.World/IO/Streams/ByteBuffer.h @@ -27,7 +27,7 @@ public: int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO uint8_t get(int index); - __int64 getLong(); + int64_t getLong(); short getShort(); void getShortArray(shortArray& s); ByteBuffer* put(int index, uint8_t b); @@ -35,7 +35,7 @@ public: ByteBuffer* putInt(unsigned int index, int value); ByteBuffer* putShort(short value); ByteBuffer* putShortArray(shortArray& s); - ByteBuffer* putLong(__int64 value); + ByteBuffer* putLong(int64_t value); ByteBuffer* put(byteArray inputArray); byteArray array(); IntBuffer* asIntBuffer(); diff --git a/Minecraft.World/IO/Streams/DataInput.h b/Minecraft.World/IO/Streams/DataInput.h index 2657ae1d9..0a924f1ab 100644 --- a/Minecraft.World/IO/Streams/DataInput.h +++ b/Minecraft.World/IO/Streams/DataInput.h @@ -12,7 +12,7 @@ public: virtual double readDouble() = 0; virtual float readFloat() = 0; virtual int readInt() = 0; - virtual __int64 readLong() = 0; + virtual int64_t readLong() = 0; virtual short readShort() = 0; virtual wchar_t readChar() = 0; virtual std::wstring readUTF() = 0; diff --git a/Minecraft.World/IO/Streams/DataInputStream.cpp b/Minecraft.World/IO/Streams/DataInputStream.cpp index 5b459faba..b63620c0b 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.cpp +++ b/Minecraft.World/IO/Streams/DataInputStream.cpp @@ -227,7 +227,7 @@ bool DataInputStream::readFully(charArray b) { // the writeDouble method of interface DataOutput. Returns: the double value // read. double DataInputStream::readDouble() { - __int64 bits = readLong(); + int64_t bits = readLong(); return Double::longBitsToDouble(bits); } @@ -283,22 +283,22 @@ int DataInputStream::readInt() { // // Returns: // the long value read. -__int64 DataInputStream::readLong() { +int64_t DataInputStream::readLong() { if (stream == NULL) { app.DebugPrintf( "DataInputStream::readLong() but underlying stream is NULL\n"); return 0; } - __int64 a = stream->read(); - __int64 b = stream->read(); - __int64 c = stream->read(); - __int64 d = stream->read(); - __int64 e = stream->read(); - __int64 f = stream->read(); - __int64 g = stream->read(); - __int64 h = stream->read(); + int64_t a = stream->read(); + int64_t b = stream->read(); + int64_t c = stream->read(); + int64_t d = stream->read(); + int64_t e = stream->read(); + int64_t f = stream->read(); + int64_t g = stream->read(); + int64_t h = stream->read(); - __int64 bits = + int64_t bits = (((a & 0xff) << 56) | ((b & 0xff) << 48) | ((c & 0xff) << 40) | ((d & 0xff) << 32) | ((e & 0xff) << 24) | ((f & 0xff) << 16) | ((g & 0xff) << 8) | ((h & 0xff))); @@ -596,6 +596,6 @@ void DataInputStream::deleteChildStream() { delete stream; } // pos and k is returned. Overrides: skip in class InputStream Parameters: n - // the number of bytes to be skipped. Returns: the actual number of bytes // skipped. -__int64 DataInputStream::skip(__int64 n) { return stream->skip(n); } +int64_t DataInputStream::skip(int64_t n) { return stream->skip(n); } int DataInputStream::skipBytes(int n) { return skip(n); } diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/IO/Streams/DataInputStream.h index 0fd772129..f5365cc79 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.h +++ b/Minecraft.World/IO/Streams/DataInputStream.h @@ -24,12 +24,12 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual std::wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/DataOutput.h b/Minecraft.World/IO/Streams/DataOutput.h index ef69149fc..802b310ba 100644 --- a/Minecraft.World/IO/Streams/DataOutput.h +++ b/Minecraft.World/IO/Streams/DataOutput.h @@ -10,7 +10,7 @@ public: virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; - virtual void writeLong(__int64 a) = 0; + virtual void writeLong(int64_t a) = 0; virtual void writeShort(short a) = 0; virtual void writeBoolean(bool v) = 0; virtual void writeChar(wchar_t v) = 0; diff --git a/Minecraft.World/IO/Streams/DataOutputStream.cpp b/Minecraft.World/IO/Streams/DataOutputStream.cpp index 4d2286003..b763c7331 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.cpp +++ b/Minecraft.World/IO/Streams/DataOutputStream.cpp @@ -86,7 +86,7 @@ void DataOutputStream::writeByte(uint8_t a) { // counter written is incremented by 8. Parameters: v - a double value to be // written. void DataOutputStream::writeDouble(double a) { - __int64 bits = Double::doubleToLongBits(a); + int64_t bits = Double::doubleToLongBits(a); writeLong(bits); // TODO 4J Stu - Error handling? @@ -122,7 +122,7 @@ void DataOutputStream::writeInt(int a) { // first. In no exception is thrown, the counter written is incremented by 8. // Parameters: // v - a long to be written. -void DataOutputStream::writeLong(__int64 a) { +void DataOutputStream::writeLong(int64_t a) { stream->write((a >> 56) & 0xff); stream->write((a >> 48) & 0xff); stream->write((a >> 40) & 0xff); diff --git a/Minecraft.World/IO/Streams/DataOutputStream.h b/Minecraft.World/IO/Streams/DataOutputStream.h index de0ad9451..113ae561a 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.h +++ b/Minecraft.World/IO/Streams/DataOutputStream.h @@ -27,7 +27,7 @@ public: virtual void writeDouble(double a); virtual void writeFloat(float a); virtual void writeInt(int a); - virtual void writeLong(__int64 a); + virtual void writeLong(int64_t a); virtual void writeShort(short a); virtual void writeChar(wchar_t a); virtual void writeChars(const std::wstring& a); diff --git a/Minecraft.World/IO/Streams/GZIPInputStream.h b/Minecraft.World/IO/Streams/GZIPInputStream.h index a69432416..aaa6343f5 100644 --- a/Minecraft.World/IO/Streams/GZIPInputStream.h +++ b/Minecraft.World/IO/Streams/GZIPInputStream.h @@ -16,5 +16,5 @@ public: return stream->read(b, offset, length); }; virtual void close() { return stream->close(); }; - virtual __int64 skip(__int64 n) { return 0; }; + virtual int64_t skip(int64_t n) { return 0; }; }; \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/InputStream.h b/Minecraft.World/IO/Streams/InputStream.h index e191686ca..5ec00bd5f 100644 --- a/Minecraft.World/IO/Streams/InputStream.h +++ b/Minecraft.World/IO/Streams/InputStream.h @@ -10,7 +10,7 @@ public: virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual void close() = 0; - virtual __int64 skip(__int64 n) = 0; + virtual int64_t skip(int64_t n) = 0; static InputStream* getResourceAsStream(const std::wstring& fileName); }; \ No newline at end of file diff --git a/Minecraft.World/Level/Level.cpp b/Minecraft.World/Level/Level.cpp index 8a88dd68f..f9e0245e8 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/Level/Level.cpp @@ -3179,7 +3179,7 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool force, bool rootOnlyEmissive) { lightCache_t* cache = static_cast(LevelTlsGetValue(tlsIdxLightCache)); - __uint64 cacheUse = 0; + uint64_t cacheUse = 0; if (force) { // 4J - special mode added so we can do lava lighting updates without diff --git a/Minecraft.World/Level/RandomLevelSource.cpp b/Minecraft.World/Level/RandomLevelSource.cpp index 61e8e3361..500318bc3 100644 --- a/Minecraft.World/Level/RandomLevelSource.cpp +++ b/Minecraft.World/Level/RandomLevelSource.cpp @@ -783,8 +783,8 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; // 4jcraft added casts to a higher int and unsigned pprandom->setSeed((((uint64_t)xt * (uint64_t)xScale) + ((uint64_t)zt * (uint64_t)zScale)) ^ diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp b/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp index ea90e3542..cef015625 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp @@ -276,8 +276,8 @@ void McRegionChunkStorage::saveEntities(Level* level, LevelChunk* levelChunk) { void McRegionChunkStorage::loadEntities(Level* level, LevelChunk* levelChunk) { #ifdef SPLIT_SAVES - __int64 index = ((__int64)(levelChunk->x) << 32) | - (((__int64)(levelChunk->z)) & 0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | + (((int64_t)(levelChunk->z)) & 0x00000000FFFFFFFF); AUTO_VAR(it, m_entityData.find(index)); if (it != m_entityData.end()) { diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.h b/Minecraft.World/Level/Storage/McRegionChunkStorage.h index 8162d05b8..b82ac6474 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.h +++ b/Minecraft.World/Level/Storage/McRegionChunkStorage.h @@ -14,7 +14,7 @@ private: ConsoleSaveFile* m_saveFile; static CRITICAL_SECTION cs_memory; - std::unordered_map<__int64, byteArray> m_entityData; + std::unordered_map m_entityData; static std::deque s_chunkDataQueue; static int s_runningThreadCount; diff --git a/Minecraft.World/Level/Storage/OldChunkStorage.cpp b/Minecraft.World/Level/Storage/OldChunkStorage.cpp index 0ee095902..d8f189c77 100644 --- a/Minecraft.World/Level/Storage/OldChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/OldChunkStorage.cpp @@ -306,7 +306,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level, std::vector* ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag* tickTags = new ListTag(); for (int i = 0; i < ticksInChunk->size(); i++) { @@ -405,7 +405,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level, CompoundTag* tag) { std::vector* ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag* tickTags = new ListTag(); for (int i = 0; i < ticksInChunk->size(); i++) { diff --git a/Minecraft.World/Network/Packets/LoginPacket.cpp b/Minecraft.World/Network/Packets/LoginPacket.cpp index be8e0918c..d46ba8a1b 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.cpp +++ b/Minecraft.World/Network/Packets/LoginPacket.cpp @@ -68,7 +68,7 @@ LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, // Server -> Client LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, - LevelType* pLevelType, __int64 seed, int gameType, + LevelType* pLevelType, int64_t seed, int gameType, char dimension, std::uint8_t mapHeight, std::uint8_t maxPlayers, char difficulty, int multiplayerInstanceId, std::uint8_t playerIndex, @@ -175,7 +175,7 @@ int LoginPacket::getEstimatedSize() { length = (int)m_pLevelType->getGeneratorName().length(); } - return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2 * sizeof(PlayerUID)) + 1 + sizeof(char) + sizeof(std::uint8_t) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); diff --git a/Minecraft.World/Network/Packets/LoginPacket.h b/Minecraft.World/Network/Packets/LoginPacket.h index c96efc261..f236a1aa5 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.h +++ b/Minecraft.World/Network/Packets/LoginPacket.h @@ -10,7 +10,7 @@ class LoginPacket : public Packet, public: int clientVersion; std::wstring userName; - __int64 seed; + int64_t seed; char dimension; PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added char difficulty; // 4J Added @@ -33,7 +33,7 @@ public: LoginPacket(); LoginPacket(const std::wstring& userName, int clientVersion, - LevelType* pLevelType, __int64 seed, int gameType, + LevelType* pLevelType, int64_t seed, int gameType, char dimension, std::uint8_t mapHeight, std::uint8_t maxPlayers, char difficulty, int m_multiplayerInstanceId, std::uint8_t playerIndex, bool newSeaLevel, diff --git a/Minecraft.World/Network/Packets/Packet.cpp b/Minecraft.World/Network/Packets/Packet.cpp index 0043dff62..9db3b3676 100644 --- a/Minecraft.World/Network/Packets/Packet.cpp +++ b/Minecraft.World/Network/Packets/Packet.cpp @@ -363,9 +363,9 @@ void Packet::renderAllPacketStatsKey() { #endif } -__int64 Packet::getIndexedStatValue(unsigned int samplePos, +int64_t Packet::getIndexedStatValue(unsigned int samplePos, unsigned int renderableId) { - __int64 val = 0; + int64_t val = 0; #ifndef _CONTENT_PACKAGE #if PACKET_ENABLE_STAT_TRACKING @@ -615,7 +615,7 @@ void Packet::PacketStatistics::renderStats() { #endif } -__int64 Packet::PacketStatistics::getCountSample(int samplePos) { +int64_t Packet::PacketStatistics::getCountSample(int samplePos) { if (samplePos == 511) { samplesPos++; countSamples[samplesPos & (512 - 1)] = 0; diff --git a/Minecraft.World/Network/Packets/Packet.h b/Minecraft.World/Network/Packets/Packet.h index 2efa9ff70..cd1ef3c3d 100644 --- a/Minecraft.World/Network/Packets/Packet.h +++ b/Minecraft.World/Network/Packets/Packet.h @@ -20,10 +20,10 @@ public: int totalSize; // 4J Added - __int64 countSamples[512]; - __int64 sizeSamples[512]; + int64_t countSamples[512]; + int64_t sizeSamples[512]; int samplesPos; - __int64 firstSampleTime; + int64_t firstSampleTime; public: const int id; @@ -44,7 +44,7 @@ public: // 4J Added void renderStats(); - __int64 getCountSample(int samplePos); + int64_t getCountSample(int samplePos); std::wstring getLegendString(); }; @@ -68,7 +68,7 @@ public: const std::type_info& clazz, packetCreateFn); public: - const __int64 createTime; + const int64_t createTime; Packet(); virtual ~Packet() {} @@ -97,7 +97,7 @@ public: static void renderPacketStats(int id); static void renderAllPacketStats(); static void renderAllPacketStatsKey(); - static __int64 getIndexedStatValue(unsigned int samplePos, + static int64_t getIndexedStatValue(unsigned int samplePos, unsigned int renderableId); private: diff --git a/Minecraft.World/Network/Packets/RespawnPacket.cpp b/Minecraft.World/Network/Packets/RespawnPacket.cpp index 093be14a4..ba4678979 100644 --- a/Minecraft.World/Network/Packets/RespawnPacket.cpp +++ b/Minecraft.World/Network/Packets/RespawnPacket.cpp @@ -18,7 +18,7 @@ RespawnPacket::RespawnPacket() { m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType* playerGameType, char difficulty, LevelType* pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { diff --git a/Minecraft.World/Network/Packets/RespawnPacket.h b/Minecraft.World/Network/Packets/RespawnPacket.h index ae8fd2e0b..bcbcd8f9e 100644 --- a/Minecraft.World/Network/Packets/RespawnPacket.h +++ b/Minecraft.World/Network/Packets/RespawnPacket.h @@ -10,7 +10,7 @@ class RespawnPacket : public Packet, public: char dimension; char difficulty; - __int64 mapSeed; + int64_t mapSeed; int mapHeight; GameType* playerGameType; bool m_newSeaLevel; // 4J added @@ -20,7 +20,7 @@ public: int m_hellScale; // 4J Added RespawnPacket(); - RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, + RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType* playerGameType, char difficulty, LevelType* pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale); diff --git a/Minecraft.World/Network/Packets/SetTimePacket.cpp b/Minecraft.World/Network/Packets/SetTimePacket.cpp index 8661c352f..5ba8046ff 100644 --- a/Minecraft.World/Network/Packets/SetTimePacket.cpp +++ b/Minecraft.World/Network/Packets/SetTimePacket.cpp @@ -6,7 +6,7 @@ SetTimePacket::SetTimePacket() { time = 0; } -SetTimePacket::SetTimePacket(__int64 time) { this->time = time; } +SetTimePacket::SetTimePacket(int64_t time) { this->time = time; } void SetTimePacket::read(DataInputStream* dis) // throws IOException { diff --git a/Minecraft.World/Network/Packets/SetTimePacket.h b/Minecraft.World/Network/Packets/SetTimePacket.h index 5e09c041a..fa5d2097b 100644 --- a/Minecraft.World/Network/Packets/SetTimePacket.h +++ b/Minecraft.World/Network/Packets/SetTimePacket.h @@ -5,10 +5,10 @@ class SetTimePacket : public Packet, public std::enable_shared_from_this { public: - __int64 time; + int64_t time; SetTimePacket(); - SetTimePacket(__int64 time); + SetTimePacket(int64_t time); virtual void read(DataInputStream* dis); virtual void write(DataOutputStream* dos); diff --git a/Minecraft.World/Network/Socket.h b/Minecraft.World/Network/Socket.h index da2830b5c..dd811d940 100644 --- a/Minecraft.World/Network/Socket.h +++ b/Minecraft.World/Network/Socket.h @@ -42,7 +42,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} @@ -78,7 +78,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} diff --git a/Minecraft.World/Platform/System.cpp b/Minecraft.World/Platform/System.cpp index 789b4760e..bece637ef 100644 --- a/Minecraft.World/Platform/System.cpp +++ b/Minecraft.World/Platform/System.cpp @@ -63,7 +63,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, // // Returns: // The current value of the system timer, in nanoseconds. -__int64 System::nanoTime() { +int64_t System::nanoTime() { #if !defined(__linux__) return GetTickCount() * 1000000LL; #else @@ -83,7 +83,7 @@ __int64 System::nanoTime() { // Returns: // the difference, measured in milliseconds, between the current time and // midnight, January 1, 1970 UTC. -__int64 System::currentTimeMillis() { +int64_t System::currentTimeMillis() { #ifdef __PS3__ // sys_time_get_current_time() obtains the elapsed time since Epoch //(1970/01/01 00:00:00 UTC). The value is separated into two parts: sec @@ -92,7 +92,7 @@ __int64 System::currentTimeMillis() { sys_time_sec_t sec; sys_time_nsec_t nsec; sys_time_get_current_time(&sec, &nsec); - __int64 msec = (sec * 1000) + (nsec / (1000 * 1000)); + int64_t msec = (sec * 1000) + (nsec / (1000 * 1000)); return msec; #elif defined __ORBIS__ @@ -105,7 +105,7 @@ __int64 System::currentTimeMillis() { return sceKernelGetProcessTimeWide() / 1000; /* SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime;*/ #elif defined(__linux__) @@ -134,11 +134,11 @@ __int64 System::currentTimeMillis() { // 4J Stu - Added this so that we can use real-world timestamps in PSVita saves. // Particularly required for the save transfers to be smooth -__int64 System::currentRealTimeMillis() { +int64_t System::currentRealTimeMillis() { #ifdef __PSVITA__ SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + @@ -200,8 +200,8 @@ void System::ReverseINT(int* piVal) { pchVal1[3] = pchVal2[0]; } -void System::ReverseULONGLONG(__int64* pullVal) { - __int64 ullValue = *pullVal; +void System::ReverseULONGLONG(int64_t* pullVal) { + int64_t ullValue = *pullVal; unsigned char* pchVal1 = (unsigned char*)pullVal; unsigned char* pchVal2 = (unsigned char*)&ullValue; diff --git a/Minecraft.World/Platform/System.h b/Minecraft.World/Platform/System.h index f8e43db92..e06fe76db 100644 --- a/Minecraft.World/Platform/System.h +++ b/Minecraft.World/Platform/System.h @@ -25,9 +25,9 @@ public: ArrayCopyFunctionDeclaration(uint8_t) ArrayCopyFunctionDeclaration(Node*) ArrayCopyFunctionDeclaration(Biome*) ArrayCopyFunctionDeclaration(int) - static __int64 nanoTime(); - static __int64 currentTimeMillis(); - static __int64 currentRealTimeMillis(); // 4J Added to get real-world time + static int64_t nanoTime(); + static int64_t currentTimeMillis(); + static int64_t currentRealTimeMillis(); // 4J Added to get real-world time // for timestamps in saves static void ReverseUSHORT(unsigned short* pusVal); @@ -35,7 +35,7 @@ public: static void ReverseULONG(unsigned long* pulVal); static void ReverseULONG(unsigned int* pulVal); static void ReverseINT(int* piVal); - static void ReverseULONGLONG(__int64* pullVal); + static void ReverseULONGLONG(int64_t* pullVal); static void ReverseWCHARA(WCHAR* pwch, int iLen); }; diff --git a/Minecraft.World/Platform/stdafx.h b/Minecraft.World/Platform/stdafx.h index 60de6647d..0df30460f 100644 --- a/Minecraft.World/Platform/stdafx.h +++ b/Minecraft.World/Platform/stdafx.h @@ -10,7 +10,7 @@ #endif #if (defined _XBOX || defined _WINDOWS64 || defined _DURANGO) -typedef unsigned __int64 __uint64; +typedef unsigned int64_t uint64_t; #endif #ifdef _WINDOWS64 diff --git a/Minecraft.World/Util/BasicTypeContainers.h b/Minecraft.World/Util/BasicTypeContainers.h index 0cf134ad5..494b1797f 100644 --- a/Minecraft.World/Util/BasicTypeContainers.h +++ b/Minecraft.World/Util/BasicTypeContainers.h @@ -45,9 +45,9 @@ public: } static bool isInfinite(double a) { return false; /*4J TODO*/ } - static double longBitsToDouble(__int64 bits) { return *(double*)&bits; } + static double longBitsToDouble(int64_t bits) { return *(double*)&bits; } - static __int64 doubleToLongBits(double d) { return *(__int64*)&d; } + static int64_t doubleToLongBits(double d) { return *(int64_t*)&d; } }; // 4J Stu - The String class should only be used if we need to use the diff --git a/Minecraft.World/Util/C4JThread.h b/Minecraft.World/Util/C4JThread.h index c2a1b9b34..a567696ff 100644 --- a/Minecraft.World/Util/C4JThread.h +++ b/Minecraft.World/Util/C4JThread.h @@ -181,7 +181,7 @@ private: bool m_isRunning; bool m_hasStarted; int m_exitCode; - __int64 m_lastSleepTime; + int64_t m_lastSleepTime; static std::vector ms_threadList; static CRITICAL_SECTION ms_threadListCS; diff --git a/Minecraft.World/Util/JavaIntHash.h b/Minecraft.World/Util/JavaIntHash.h index 138b7202a..476baae56 100644 --- a/Minecraft.World/Util/JavaIntHash.h +++ b/Minecraft.World/Util/JavaIntHash.h @@ -44,13 +44,13 @@ struct LongKeyHash { return (int)(h ^ (h >> 7) ^ (h >> 4)); } - int operator()(const __int64& k) const { - return hash((int)(k ^ (((__uint64)k) >> 32))); + int operator()(const int64_t& k) const { + return hash((int)(k ^ (((uint64_t)k) >> 32))); } }; struct LongKeyEq { - bool operator()(const __int64& x, const __int64& y) const { return x == y; } + bool operator()(const int64_t& x, const int64_t& y) const { return x == y; } }; struct eINSTANCEOFKeyHash { diff --git a/Minecraft.World/Util/JavaMath.cpp b/Minecraft.World/Util/JavaMath.cpp index b6a8b8fe1..80c212733 100644 --- a/Minecraft.World/Util/JavaMath.cpp +++ b/Minecraft.World/Util/JavaMath.cpp @@ -34,7 +34,7 @@ double Math::random() { return Math::rand.nextDouble(); } // the value of Long.MAX_VALUE, the result is equal to the value of // Long.MAX_VALUE. Parameters: a - a floating-point value to be rounded to a // long. Returns: the value of the argument rounded to the nearest long value. -__int64 Math::round(double d) { +int64_t Math::round(double d) { // 4jcraft fixes the fact that if double is a huge // number than the cast of d to int64_t overflows diff --git a/Minecraft.World/Util/JavaMath.h b/Minecraft.World/Util/JavaMath.h index aac3fb477..b16044d04 100644 --- a/Minecraft.World/Util/JavaMath.h +++ b/Minecraft.World/Util/JavaMath.h @@ -7,7 +7,7 @@ private: public: static double random(); - static __int64 round(double d); + static int64_t round(double d); static int _max(int a, int b); static float _max(float a, float b); static int _min(int a, int b); diff --git a/Minecraft.World/Util/Language.cpp b/Minecraft.World/Util/Language.cpp index d3784d179..8c7f854bd 100644 --- a/Minecraft.World/Util/Language.cpp +++ b/Minecraft.World/Util/Language.cpp @@ -15,7 +15,7 @@ Language::Language() { if (langFile.exists()) { InputStream* stream = new FileInputStream(langFile); if (stream) { - __int64 fileSize = langFile.length(); + int64_t fileSize = langFile.length(); if (fileSize > 0) { // 4jcraft: we would've used BufferedReader like the JE // equivalent here, but the lang file starts with a newline, diff --git a/Minecraft.World/Util/Mth.cpp b/Minecraft.World/Util/Mth.cpp index a4c27aff5..5a080a71c 100644 --- a/Minecraft.World/Util/Mth.cpp +++ b/Minecraft.World/Util/Mth.cpp @@ -55,8 +55,8 @@ int Mth::floor(float v) { return v < i ? i - 1 : i; } -__int64 Mth::lfloor(double v) { - __int64 i = (__int64)v; +int64_t Mth::lfloor(double v) { + int64_t i = (int64_t)v; return v < i ? i - 1 : i; } diff --git a/Minecraft.World/Util/Mth.h b/Minecraft.World/Util/Mth.h index e3c8a9145..3802ef3be 100644 --- a/Minecraft.World/Util/Mth.h +++ b/Minecraft.World/Util/Mth.h @@ -25,7 +25,7 @@ public: static float sqrt(float x); static float sqrt(double x); static int floor(float v); - static __int64 lfloor(double v); + static int64_t lfloor(double v); static int fastFloor(double x); static int floor(double v); static int absFloor(double v); diff --git a/Minecraft.World/Util/PortableFileIO.h b/Minecraft.World/Util/PortableFileIO.h index 037bcdb4a..fe6925143 100644 --- a/Minecraft.World/Util/PortableFileIO.h +++ b/Minecraft.World/Util/PortableFileIO.h @@ -31,17 +31,17 @@ inline std::FILE* OpenBinaryFileForRead(const std::wstring& path) { inline bool Seek(std::FILE* file, std::size_t offset, int origin) { #if defined(_WIN32) - return _fseeki64(file, static_cast<__int64>(offset), origin) == 0; + return _fseeki64(file, static_cast(offset), origin) == 0; #else return fseeko(file, static_cast(offset), origin) == 0; #endif } -inline __int64 Tell(std::FILE* file) { +inline int64_t Tell(std::FILE* file) { #if defined(_WIN32) return _ftelli64(file); #else - return static_cast<__int64>(ftello(file)); + return static_cast(ftello(file)); #endif } @@ -57,7 +57,7 @@ inline BinaryReadResult ReadBinaryFile(const std::wstring& path, void* buffer, return {BinaryReadStatus::read_error, 0, 0}; } - const __int64 endPosition = Tell(stream); + const int64_t endPosition = Tell(stream); if (endPosition < 0) { std::fclose(stream); return {BinaryReadStatus::read_error, 0, 0}; @@ -97,7 +97,7 @@ inline BinaryReadResult ReadBinaryFileSegment(const std::wstring& path, return {BinaryReadStatus::read_error, 0, 0}; } - const __int64 endPosition = Tell(stream); + const int64_t endPosition = Tell(stream); if (endPosition < 0) { std::fclose(stream); return {BinaryReadStatus::read_error, 0, 0}; diff --git a/Minecraft.World/Util/Random.cpp b/Minecraft.World/Util/Random.cpp index cd15b4a89..55bead661 100644 --- a/Minecraft.World/Util/Random.cpp +++ b/Minecraft.World/Util/Random.cpp @@ -8,7 +8,7 @@ Random::Random() { // 4J - jave now uses the system nanosecond counter added to a // "seedUniquifier" to get an initial seed. Our nanosecond timer is actually // only millisecond accuate, so use QueryPerformanceCounter here instead - __int64 seed; + int64_t seed; struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); @@ -20,9 +20,9 @@ Random::Random() { setSeed(seed); } -Random::Random(__int64 seed) { setSeed(seed); } +Random::Random(int64_t seed) { setSeed(seed); } -void Random::setSeed(__int64 s) { +void Random::setSeed(int64_t s) { this->seed = (s ^ 0x5DEECE66DLL) & ((1LL << 48) - 1); haveNextNextGaussian = false; } @@ -41,7 +41,7 @@ void Random::nextBytes(uint8_t* bytes, unsigned int count) { } double Random::nextDouble() { - return (((__int64)next(26) << 27) + next(27)) / (double)(1LL << 53); + return (((int64_t)next(26) << 27) + next(27)) / (double)(1LL << 53); } double Random::nextGaussian() { @@ -70,7 +70,7 @@ int Random::nextInt(int n) { if ((n & -n) == n) // i.e., n is a power of 2 // 4jcraft added casts to unsigned (and uint64_t) return (int)(((uint64_t)next(31) * n) >> - 31); // 4J Stu - Made __int64 instead of long + 31); // 4J Stu - Made int64_t instead of long int bits, val; do { @@ -83,7 +83,7 @@ int Random::nextInt(int n) { float Random::nextFloat() { return next(24) / ((float)(1 << 24)); } -__int64 Random::nextLong() { +int64_t Random::nextLong() { // 4jcraft added casts to unsigned return (int64_t)((uint64_t)next(32) << 32) + next(32); } diff --git a/Minecraft.World/Util/Random.h b/Minecraft.World/Util/Random.h index 0efb1838d..40b3e45d2 100644 --- a/Minecraft.World/Util/Random.h +++ b/Minecraft.World/Util/Random.h @@ -2,7 +2,7 @@ class Random { private: - __int64 seed; + int64_t seed; bool haveNextNextGaussian; double nextNextGaussian; @@ -11,14 +11,14 @@ protected: public: Random(); - Random(__int64 seed); - void setSeed(__int64 s); + Random(int64_t seed); + void setSeed(int64_t s); void nextBytes(uint8_t* bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); int nextInt(int to); float nextFloat(); - __int64 nextLong(); + int64_t nextLong(); bool nextBoolean(); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp b/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp index 35f9639c0..d647ffa1f 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp +++ b/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp @@ -83,8 +83,8 @@ BiomeCache::Block* BiomeCache::getBlockAt(int x, int z) { EnterCriticalSection(&m_CS); x >>= ZONE_SIZE_BITS; z >>= ZONE_SIZE_BITS; - __int64 slot = - (((__int64)x) & 0xffffffffl) | ((((__int64)z) & 0xffffffffl) << 32l); + int64_t slot = + (((int64_t)x) & 0xffffffffl) | ((((int64_t)z) & 0xffffffffl) << 32l); AUTO_VAR(it, cached.find(slot)); Block* block = NULL; if (it == cached.end()) { @@ -115,18 +115,18 @@ float BiomeCache::getDownfall(int x, int z) { void BiomeCache::update() { EnterCriticalSection(&m_CS); - __int64 now = app.getAppTime(); - __int64 utime = now - lastUpdateTime; + int64_t now = app.getAppTime(); + int64_t utime = now - lastUpdateTime; if (utime > DECAY_TIME / 4 || utime < 0) { lastUpdateTime = now; for (AUTO_VAR(it, all.begin()); it != all.end();) { Block* block = *it; - __int64 time = now - block->lastUse; + int64_t time = now - block->lastUse; if (time > DECAY_TIME || time < 0) { it = all.erase(it); - __int64 slot = (((__int64)block->x) & 0xffffffffl) | - ((((__int64)block->z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t)block->x) & 0xffffffffl) | + ((((int64_t)block->z) & 0xffffffffl) << 32l); cached.erase(slot); delete block; } else { diff --git a/Minecraft.World/WorldGen/Biomes/BiomeCache.h b/Minecraft.World/WorldGen/Biomes/BiomeCache.h index 5e64db0e8..9c7601800 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeCache.h +++ b/Minecraft.World/WorldGen/Biomes/BiomeCache.h @@ -9,7 +9,7 @@ private: static const int ZONE_SIZE_MASK = ZONE_SIZE - 1; const BiomeSource* source; - __int64 lastUpdateTime; + int64_t lastUpdateTime; public: class Block { @@ -21,7 +21,7 @@ public: // BiomeArray biomes; byteArray biomeIndices; int x, z; - __int64 lastUse; + int64_t lastUse; Block(int x, int z, BiomeCache* parent); ~Block(); @@ -31,7 +31,7 @@ public: }; private: - std::unordered_map<__int64, Block*, LongKeyHash, LongKeyEq> + std::unordered_map cached; // 4J - was LongHashMap std::vector all; // was ArrayList diff --git a/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp b/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp index 6827a4f46..d1f981a62 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp +++ b/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp @@ -27,7 +27,7 @@ void BiomeSource::_init() { playerSpawnBiomes.push_back(Biome::jungleHills); } -void BiomeSource::_init(__int64 seed, LevelType* generator) { +void BiomeSource::_init(int64_t seed, LevelType* generator) { _init(); LayerArray layers = Layer::getDefaultLayers(seed, generator); @@ -40,7 +40,7 @@ void BiomeSource::_init(__int64 seed, LevelType* generator) { BiomeSource::BiomeSource() { _init(); } // 4J added -BiomeSource::BiomeSource(__int64 seed, LevelType* generator) { +BiomeSource::BiomeSource(int64_t seed, LevelType* generator) { _init(seed, generator); } @@ -359,16 +359,16 @@ void BiomeSource::update() { cache->update(); } // 4J added - find a seed for this biomesource that matches certain criteria #ifdef __PSVITA__ -__int64 BiomeSource::findSeed( +int64_t BiomeSource::findSeed( LevelType* generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this // on Vita as it can take up to 60 secs #else -__int64 BiomeSource::findSeed(LevelType* generator) +int64_t BiomeSource::findSeed(LevelType* generator) #endif { - __int64 bestSeed = 0; + int64_t bestSeed = 0; ProgressRenderer* mcprogress = Minecraft::GetInstance()->progressRenderer; mcprogress->progressStage(IDS_PROGRESS_NEW_WORLD_SEED); @@ -410,7 +410,7 @@ __int64 BiomeSource::findSeed(LevelType* generator) // Just keeping trying to generate seeds until we find one that // matches our criteria do { - __int64 seed = pr->nextLong(); + int64_t seed = pr->nextLong(); BiomeSource* biomeSource = new BiomeSource(seed, generator); biomeSource->getRawBiomeIndices( diff --git a/Minecraft.World/WorldGen/Biomes/BiomeSource.h b/Minecraft.World/WorldGen/Biomes/BiomeSource.h index e6a7107ea..433260cf5 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeSource.h +++ b/Minecraft.World/WorldGen/Biomes/BiomeSource.h @@ -25,11 +25,11 @@ private: protected: void _init(); - void _init(__int64 seed, LevelType* generator); + void _init(int64_t seed, LevelType* generator); BiomeSource(); public: - BiomeSource(__int64 seed, LevelType* generator); + BiomeSource(int64_t seed, LevelType* generator); BiomeSource(Level* level); private: @@ -37,13 +37,13 @@ private: static void getFracs(intArray indices, float* fracs); // 4J added public: #ifdef __PSVITA__ - static __int64 findSeed( + static int64_t findSeed( LevelType* generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of // this on Vita as it can take up to 60 secs // // 4J added #else - static __int64 findSeed(LevelType* generator); // 4J added + static int64_t findSeed(LevelType* generator); // 4J added #endif virtual ~BiomeSource(); diff --git a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp b/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp index 7d949b606..f8c8d9007 100644 --- a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp @@ -508,7 +508,7 @@ bool BasicTree::place(Level* level, Random* random, int x, int y, int z) { // Initialize the instance fields for the level and the seed. thisLevel = level; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); rnd->setSeed(seed); // Initialize the origin of the tree trunk origin[0] = x; diff --git a/Minecraft.World/WorldGen/Features/CanyonFeature.cpp b/Minecraft.World/WorldGen/Features/CanyonFeature.cpp index 9fa41f785..7eba68bf2 100644 --- a/Minecraft.World/WorldGen/Features/CanyonFeature.cpp +++ b/Minecraft.World/WorldGen/Features/CanyonFeature.cpp @@ -4,7 +4,7 @@ #include "../../Headers/net.minecraft.world.level.tile.h" #include "../../Headers/net.minecraft.world.level.biome.h" -void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, +void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { diff --git a/Minecraft.World/WorldGen/Features/CanyonFeature.h b/Minecraft.World/WorldGen/Features/CanyonFeature.h index 9f3b137b7..e35668b8e 100644 --- a/Minecraft.World/WorldGen/Features/CanyonFeature.h +++ b/Minecraft.World/WorldGen/Features/CanyonFeature.h @@ -8,7 +8,7 @@ private: float rs[1024]; protected: - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level* level, int x, int z, int xOffs, int zOffs, diff --git a/Minecraft.World/WorldGen/Features/CaveFeature.cpp b/Minecraft.World/WorldGen/Features/CaveFeature.cpp index 53e77a335..4e17f8b95 100644 --- a/Minecraft.World/WorldGen/Features/CaveFeature.cpp +++ b/Minecraft.World/WorldGen/Features/CaveFeature.cpp @@ -18,7 +18,7 @@ bool CaveFeature::place(Level* level, Random* random, int x, int y, int z) { double radius = random->nextDouble() * 4 + 2; double fuss = random->nextDouble() * 0.6; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); random->setSeed(seed); std::vector toRemove; diff --git a/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp b/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp index 30a1c1fb7..c64f16943 100644 --- a/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp +++ b/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp @@ -4,14 +4,14 @@ #include "../../Headers/net.minecraft.world.level.biome.h" #include "LargeCaveFeature.h" -void LargeCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, +void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5); } -void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, +void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, diff --git a/Minecraft.World/WorldGen/Features/LargeCaveFeature.h b/Minecraft.World/WorldGen/Features/LargeCaveFeature.h index 7e60aaf1e..aa02f615a 100644 --- a/Minecraft.World/WorldGen/Features/LargeCaveFeature.h +++ b/Minecraft.World/WorldGen/Features/LargeCaveFeature.h @@ -4,9 +4,9 @@ class LargeCaveFeature : public LargeFeature { protected: - void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, + void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level* level, int x, int z, int xOffs, int zOffs, diff --git a/Minecraft.World/WorldGen/Features/LargeFeature.cpp b/Minecraft.World/WorldGen/Features/LargeFeature.cpp index 10e3b57be..8233f12fa 100644 --- a/Minecraft.World/WorldGen/Features/LargeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/LargeFeature.cpp @@ -17,8 +17,8 @@ void LargeFeature::apply(ChunkSource* ChunkSource, Level* level, int xOffs, this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); for (int x = xOffs - r; x <= xOffs + r; x++) { for (int z = zOffs - r; z <= zOffs + r; z++) { diff --git a/Minecraft.World/WorldGen/Features/StructureFeature.cpp b/Minecraft.World/WorldGen/Features/StructureFeature.cpp index cf6d0b704..358a7249f 100644 --- a/Minecraft.World/WorldGen/Features/StructureFeature.cpp +++ b/Minecraft.World/WorldGen/Features/StructureFeature.cpp @@ -134,10 +134,10 @@ TilePos* StructureFeature::getNearestGeneratedFeature(Level* level, int cellX, this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); - __int64 xx = (cellX >> 4) * xScale; - __int64 zz = (cellZ >> 4) * zScale; + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); + int64_t xx = (cellX >> 4) * xScale; + int64_t zz = (cellZ >> 4) * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, cellX >> 4, cellZ >> 4, 0, 0, byteArray()); diff --git a/Minecraft.World/WorldGen/Features/StructureFeature.h b/Minecraft.World/WorldGen/Features/StructureFeature.h index c6fcca9a1..a32b74733 100644 --- a/Minecraft.World/WorldGen/Features/StructureFeature.h +++ b/Minecraft.World/WorldGen/Features/StructureFeature.h @@ -14,7 +14,7 @@ public: }; protected: - std::unordered_map<__int64, StructureStart*> cachedStructures; + std::unordered_map cachedStructures; public: ~StructureFeature(); diff --git a/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp b/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp index a2c5e59a0..d5d4afc32 100644 --- a/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Headers/net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(__int64 seedMixup, std::shared_ptr parent) +AddIslandLayer::AddIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/AddIslandLayer.h b/Minecraft.World/WorldGen/Layers/AddIslandLayer.h index 584d6bcd0..58baf28cf 100644 --- a/Minecraft.World/WorldGen/Layers/AddIslandLayer.h +++ b/Minecraft.World/WorldGen/Layers/AddIslandLayer.h @@ -4,7 +4,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(__int64 seedMixup, std::shared_ptr parent); + AddIslandLayer(int64_t seedMixup, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp b/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp index 2e4fd90a9..c963cc76e 100644 --- a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Headers/net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, +AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; diff --git a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h b/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h index 0e25b61f9..4de2dd53c 100644 --- a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h +++ b/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h @@ -3,6 +3,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(__int64 seedMixup, std::shared_ptr parent); + AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp b/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp index d10baed45..e31ed5f1b 100644 --- a/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Headers/net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(__int64 seedMixup, std::shared_ptr parent) +AddSnowLayer::AddSnowLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/AddSnowLayer.h b/Minecraft.World/WorldGen/Layers/AddSnowLayer.h index c5d56f90b..b12c514ee 100644 --- a/Minecraft.World/WorldGen/Layers/AddSnowLayer.h +++ b/Minecraft.World/WorldGen/Layers/AddSnowLayer.h @@ -3,6 +3,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(__int64 seedMixup, std::shared_ptr parent); + AddSnowLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp b/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp index c8377b5ef..102da9644 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp @@ -4,7 +4,7 @@ #include "../../Headers/net.minecraft.world.level.h" #include "BiomeInitLayer.h" -BiomeInitLayer::BiomeInitLayer(__int64 seed, std::shared_ptr parent, +BiomeInitLayer::BiomeInitLayer(int64_t seed, std::shared_ptr parent, LevelType* levelType) : Layer(seed) { this->parent = parent; diff --git a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.h b/Minecraft.World/WorldGen/Layers/BiomeInitLayer.h index c5ae6285e..2fef040b9 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.h +++ b/Minecraft.World/WorldGen/Layers/BiomeInitLayer.h @@ -9,7 +9,7 @@ private: BiomeArray startBiomes; public: - BiomeInitLayer(__int64 seed, std::shared_ptr parent, + BiomeInitLayer(int64_t seed, std::shared_ptr parent, LevelType* levelType); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp b/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp index 2580fb77a..6a348cbed 100644 --- a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp @@ -2,7 +2,7 @@ #include "../../Platform/System.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, std::shared_ptr parent) +FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } @@ -57,7 +57,7 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) { return d; } -std::shared_ptr FuzzyZoomLayer::zoom(__int64 seed, +std::shared_ptr FuzzyZoomLayer::zoom(int64_t seed, std::shared_ptr sup, int count) { std::shared_ptr result = sup; diff --git a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h b/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h index 0e657897b..2e6ed3824 100644 --- a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h +++ b/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h @@ -4,7 +4,7 @@ class FuzzyZoomLayer : public Layer { public: - FuzzyZoomLayer(__int64 seedMixup, std::shared_ptr parent); + FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -12,6 +12,6 @@ protected: int random(int a, int b, int c, int d); public: - static std::shared_ptr zoom(__int64 seed, std::shared_ptr sup, + static std::shared_ptr zoom(int64_t seed, std::shared_ptr sup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp b/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp index 9093fa8ca..b4f150103 100644 --- a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Headers/net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; diff --git a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h b/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h index 63150175e..8fecb2177 100644 --- a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h +++ b/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h @@ -3,6 +3,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(__int64 seedMixup, std::shared_ptr parent); + GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/IslandLayer.cpp b/Minecraft.World/WorldGen/Layers/IslandLayer.cpp index b24c11ab8..11dbe7409 100644 --- a/Minecraft.World/WorldGen/Layers/IslandLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/IslandLayer.cpp @@ -1,7 +1,7 @@ #include "../../Platform/stdafx.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup) {} +IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup) {} intArray IslandLayer::getArea(int xo, int yo, int w, int h) { intArray result = IntCache::allocate(w * h); diff --git a/Minecraft.World/WorldGen/Layers/IslandLayer.h b/Minecraft.World/WorldGen/Layers/IslandLayer.h index 461ab0ffa..c878a43e6 100644 --- a/Minecraft.World/WorldGen/Layers/IslandLayer.h +++ b/Minecraft.World/WorldGen/Layers/IslandLayer.h @@ -4,7 +4,7 @@ class IslandLayer : public Layer { public: - IslandLayer(__int64 seedMixup); + IslandLayer(int64_t seedMixup); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/Layer.cpp b/Minecraft.World/WorldGen/Layers/Layer.cpp index 25f4203ea..b23774313 100644 --- a/Minecraft.World/WorldGen/Layers/Layer.cpp +++ b/Minecraft.World/WorldGen/Layers/Layer.cpp @@ -16,7 +16,7 @@ libdivide::divider fast_d7(7); libdivide::divider fast_d10(10); #endif -LayerArray Layer::getDefaultLayers(__int64 seed, LevelType* levelType) { +LayerArray Layer::getDefaultLayers(int64_t seed, LevelType* levelType) { // 4J - Some changes moved here from 1.2.3. Temperature & downfall layers // are no longer created & returned, and a debug layer is isn't. For // reference with regard to future merging, things NOT brought forward from @@ -127,7 +127,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType* levelType) { return result; } -Layer::Layer(__int64 seedMixup) { +Layer::Layer(int64_t seedMixup) { parent = nullptr; // 4jcraft added casts to prevent signed int overflow @@ -143,7 +143,7 @@ Layer::Layer(__int64 seedMixup) { this->seedMixup = (uint64_t)this->seedMixup + seedMixup; } -void Layer::init(__int64 seed) { +void Layer::init(int64_t seed) { this->seed = seed; if (parent != NULL) parent->init(seed); // 4jcraft added casts to prevent signed int overflow @@ -158,7 +158,7 @@ void Layer::init(__int64 seed) { this->seed = (uint64_t)this->seed + seedMixup; } -void Layer::initRandom(__int64 x, __int64 y) { +void Layer::initRandom(int64_t x, int64_t y) { rval = seed; // 4jcraft added casts to prevent signed int overflow rval *= (uint64_t)rval * 6364136223846793005l + 1442695040888963407l; diff --git a/Minecraft.World/WorldGen/Layers/Layer.h b/Minecraft.World/WorldGen/Layers/Layer.h index 58090e3f8..a4215e7ae 100644 --- a/Minecraft.World/WorldGen/Layers/Layer.h +++ b/Minecraft.World/WorldGen/Layers/Layer.h @@ -10,23 +10,23 @@ class LevelType; class Layer { private: - __int64 seed; + int64_t seed; protected: std::shared_ptr parent; private: - __int64 rval; - __int64 seedMixup; + int64_t rval; + int64_t seedMixup; public: - static LayerArray getDefaultLayers(__int64 seed, LevelType* levelType); + static LayerArray getDefaultLayers(int64_t seed, LevelType* levelType); - Layer(__int64 seedMixup); + Layer(int64_t seedMixup); virtual ~Layer() {} - virtual void init(__int64 seed); - virtual void initRandom(__int64 x, __int64 y); + virtual void init(int64_t seed); + virtual void initRandom(int64_t x, int64_t y); protected: int nextRandom(int max); diff --git a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp b/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp index cecccc7b3..a691c5523 100644 --- a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp @@ -3,7 +3,7 @@ #include "../../Util/IntCache.h" #include "RegionHillsLayer.h" -RegionHillsLayer::RegionHillsLayer(__int64 seed, std::shared_ptr parent) +RegionHillsLayer::RegionHillsLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.h b/Minecraft.World/WorldGen/Layers/RegionHillsLayer.h index 7e26bc6c5..108c71824 100644 --- a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.h +++ b/Minecraft.World/WorldGen/Layers/RegionHillsLayer.h @@ -4,7 +4,7 @@ class RegionHillsLayer : public Layer { public: - RegionHillsLayer(__int64 seed, std::shared_ptr parent); + RegionHillsLayer(int64_t seed, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp b/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp index cf674435b..5982e25bc 100644 --- a/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp @@ -1,7 +1,7 @@ #include "../../Platform/stdafx.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -RiverInitLayer::RiverInitLayer(__int64 seed, std::shared_ptr parent) +RiverInitLayer::RiverInitLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/RiverInitLayer.h b/Minecraft.World/WorldGen/Layers/RiverInitLayer.h index bb2f027e1..131202873 100644 --- a/Minecraft.World/WorldGen/Layers/RiverInitLayer.h +++ b/Minecraft.World/WorldGen/Layers/RiverInitLayer.h @@ -4,7 +4,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(__int64 seed, std::shared_ptr parent); + RiverInitLayer(int64_t seed, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/RiverLayer.cpp b/Minecraft.World/WorldGen/Layers/RiverLayer.cpp index 2ae4d195a..9dbe227f5 100644 --- a/Minecraft.World/WorldGen/Layers/RiverLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.biome.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(__int64 seedMixup, std::shared_ptr parent) +RiverLayer::RiverLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/RiverLayer.h b/Minecraft.World/WorldGen/Layers/RiverLayer.h index 078b26e65..8fc2c5fad 100644 --- a/Minecraft.World/WorldGen/Layers/RiverLayer.h +++ b/Minecraft.World/WorldGen/Layers/RiverLayer.h @@ -4,6 +4,6 @@ class RiverLayer : public Layer { public: - RiverLayer(__int64 seedMixup, std::shared_ptr parent); + RiverLayer(int64_t seedMixup, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp b/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp index fa448ab04..12d5be60a 100644 --- a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp @@ -2,14 +2,14 @@ #include "../../Headers/net.minecraft.world.level.biome.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(__int64 seed, std::shared_ptr biomes, +RiverMixerLayer::RiverMixerLayer(int64_t seed, std::shared_ptr biomes, std::shared_ptr rivers) : Layer(seed) { this->biomes = biomes; this->rivers = rivers; } -void RiverMixerLayer::init(__int64 seed) { +void RiverMixerLayer::init(int64_t seed) { biomes->init(seed); rivers->init(seed); Layer::init(seed); diff --git a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.h b/Minecraft.World/WorldGen/Layers/RiverMixerLayer.h index a9b39b81d..e8428ee6f 100644 --- a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.h +++ b/Minecraft.World/WorldGen/Layers/RiverMixerLayer.h @@ -8,9 +8,9 @@ private: std::shared_ptr rivers; public: - RiverMixerLayer(__int64 seed, std::shared_ptr biomes, + RiverMixerLayer(int64_t seed, std::shared_ptr biomes, std::shared_ptr rivers); - virtual void init(__int64 seed); + virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp b/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp index 133ee3ab3..54469a11e 100644 --- a/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Headers/net.minecraft.world.level.biome.h" -ShoreLayer::ShoreLayer(__int64 seed, std::shared_ptr parent) +ShoreLayer::ShoreLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/ShoreLayer.h b/Minecraft.World/WorldGen/Layers/ShoreLayer.h index 6f50c8657..276269a46 100644 --- a/Minecraft.World/WorldGen/Layers/ShoreLayer.h +++ b/Minecraft.World/WorldGen/Layers/ShoreLayer.h @@ -3,6 +3,6 @@ class ShoreLayer : public Layer { public: - ShoreLayer(__int64 seed, std::shared_ptr parent); + ShoreLayer(int64_t seed, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp b/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp index 78f8c4910..ad1b43072 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "../../Platform/stdafx.h" #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(__int64 seedMixup, std::shared_ptr parent) +SmoothLayer::SmoothLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/SmoothLayer.h b/Minecraft.World/WorldGen/Layers/SmoothLayer.h index 117164996..dcc353d4f 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothLayer.h +++ b/Minecraft.World/WorldGen/Layers/SmoothLayer.h @@ -4,7 +4,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(__int64 seedMixup, std::shared_ptr parent); + SmoothLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp b/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp index 614fe915e..1452af530 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Platform/System.h" -SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, +SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; @@ -48,7 +48,7 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) { return result; } -std::shared_ptr SmoothZoomLayer::zoom(__int64 seed, +std::shared_ptr SmoothZoomLayer::zoom(int64_t seed, std::shared_ptr sup, int count) { std::shared_ptr result = sup; diff --git a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h b/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h index 2bd8343fc..82e130ba0 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h +++ b/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h @@ -4,9 +4,9 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(__int64 seedMixup, std::shared_ptr parent); + SmoothZoomLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); - static std::shared_ptr zoom(__int64 seed, std::shared_ptr sup, + static std::shared_ptr zoom(int64_t seed, std::shared_ptr sup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp b/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp index 77a4b0411..4b722dfd2 100644 --- a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "../../Util/IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(__int64 seed, std::shared_ptr parent) +SwampRiversLayer::SwampRiversLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.h b/Minecraft.World/WorldGen/Layers/SwampRiversLayer.h index cd20ccd10..e4fdcaa96 100644 --- a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.h +++ b/Minecraft.World/WorldGen/Layers/SwampRiversLayer.h @@ -4,7 +4,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(__int64 seed, std::shared_ptr parent); + SwampRiversLayer(int64_t seed, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp b/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp index da16ab43d..a9c773e35 100644 --- a/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp +++ b/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Platform/System.h" -VoronoiZoom::VoronoiZoom(__int64 seedMixup, std::shared_ptr parent) +VoronoiZoom::VoronoiZoom(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/WorldGen/Layers/VoronoiZoom.h b/Minecraft.World/WorldGen/Layers/VoronoiZoom.h index 40faeabca..9f94e2800 100644 --- a/Minecraft.World/WorldGen/Layers/VoronoiZoom.h +++ b/Minecraft.World/WorldGen/Layers/VoronoiZoom.h @@ -4,7 +4,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(__int64 seedMixup, std::shared_ptr parent); + VoronoiZoom(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp b/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp index d5ebda59c..15a8dba8c 100644 --- a/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.newbiome.layer.h" #include "../../Platform/System.h" -ZoomLayer::ZoomLayer(__int64 seedMixup, std::shared_ptr parent) +ZoomLayer::ZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } @@ -77,7 +77,7 @@ int ZoomLayer::random(int a, int b, int c, int d) { return d; } -std::shared_ptr ZoomLayer::zoom(__int64 seed, std::shared_ptr sup, +std::shared_ptr ZoomLayer::zoom(int64_t seed, std::shared_ptr sup, int count) { std::shared_ptr result = sup; for (int i = 0; i < count; i++) { diff --git a/Minecraft.World/WorldGen/Layers/ZoomLayer.h b/Minecraft.World/WorldGen/Layers/ZoomLayer.h index a4309102c..f7150d20e 100644 --- a/Minecraft.World/WorldGen/Layers/ZoomLayer.h +++ b/Minecraft.World/WorldGen/Layers/ZoomLayer.h @@ -4,7 +4,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(__int64 seedMixup, std::shared_ptr parent); + ZoomLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); @@ -13,6 +13,6 @@ protected: int random(int a, int b, int c, int d); public: - static std::shared_ptr zoom(__int64 seed, std::shared_ptr sup, + static std::shared_ptr zoom(int64_t seed, std::shared_ptr sup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp b/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp index 50cc8f97c..8e6d3456a 100644 --- a/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp +++ b/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp @@ -67,8 +67,8 @@ doubleArray PerlinNoise::getRegion(doubleArray buffer, int x, int y, int z, double xx = x * pow * xScale; double yy = y * pow * yScale; double zz = z * pow * zScale; - __int64 xb = Mth::lfloor(xx); - __int64 zb = Mth::lfloor(zz); + int64_t xb = Mth::lfloor(xx); + int64_t zb = Mth::lfloor(zz); xx -= xb; zz -= zb; xb %= 16777216; diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp index 21ff74d1e..837db83d6 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp @@ -10,7 +10,7 @@ // FlatLevelSource::villageFeature = new VillageFeature(1); -FlatLevelSource::FlatLevelSource(Level* level, __int64 seed, +FlatLevelSource::FlatLevelSource(Level* level, int64_t seed, bool generateStructures) { m_XZSize = level->getLevelData()->getXZSize(); @@ -89,8 +89,8 @@ void FlatLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { // 4J - changed from random to pprandom so we can run in parallel with // getChunk etc. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); if (generateStructures) { diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h b/Minecraft.World/WorldGen/Sources/FlatLevelSource.h index 5d188a067..c37755ac8 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/FlatLevelSource.h @@ -23,7 +23,7 @@ private: VillageFeature* villageFeature; // = new VillageFeature(1); public: - FlatLevelSource(Level* level, __int64 seed, bool generateStructures); + FlatLevelSource(Level* level, int64_t seed, bool generateStructures); ~FlatLevelSource(); private: diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp index 3f542ef63..ad81657ec 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp @@ -4,7 +4,7 @@ #include "../../Headers/net.minecraft.world.level.storage.h" #include "HellFlatLevelSource.h" -HellFlatLevelSource::HellFlatLevelSource(Level* level, __int64 seed) { +HellFlatLevelSource::HellFlatLevelSource(Level* level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); m_XZSize = ceil((float)xzSize / hellScale); @@ -143,8 +143,8 @@ void HellFlatLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { // is consistent for each world generation. Also changed all uses of random // here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); int count = pprandom->nextInt(pprandom->nextInt(10) + 1) + 1; diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h index e89ce28b1..b89d116d0 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h @@ -25,7 +25,7 @@ private: Level* level; public: - HellFlatLevelSource(Level* level, __int64 seed); + HellFlatLevelSource(Level* level, int64_t seed); ~HellFlatLevelSource(); private: diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp index 4b7a40e85..195a99d66 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp @@ -7,7 +7,7 @@ #include "../Biomes/BiomeSource.h" #include "HellRandomLevelSource.h" -HellRandomLevelSource::HellRandomLevelSource(Level* level, __int64 seed) { +HellRandomLevelSource::HellRandomLevelSource(Level* level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); m_XZSize = ceil((float)xzSize / hellScale); @@ -449,8 +449,8 @@ void HellRandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { // is consistent for each world generation. Also changed all uses of random // here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; // 4jcraft added casts to a higher int and unsigned pprandom->setSeed((((uint64_t)xt * (uint64_t)xScale) + ((uint64_t)zt * (uint64_t)zScale)) ^ diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h index 0b35b91fb..6c952be12 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h @@ -36,7 +36,7 @@ private: Level* level; public: - HellRandomLevelSource(Level* level, __int64 seed); + HellRandomLevelSource(Level* level, int64_t seed); ~HellRandomLevelSource(); NetherBridgeFeature* netherBridgeFeature; diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp index ea7cfb160..b82d67a27 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp @@ -10,7 +10,7 @@ #include "TheEndLevelRandomLevelSource.h" TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level* level, - __int64 seed) { + int64_t seed) { m_XZSize = END_LEVEL_MIN_WIDTH; this->level = level; @@ -389,8 +389,8 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource* parent, int xt, // RandomLevelSource::postProcess to make sure this random value is // consistent for each world generation. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; // 4jcraft added cast to higher int and unsigned pprandom->setSeed((((uint64_t)xt * xScale) + ((uint64_t)zt * zScale)) ^ level->getSeed()); diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h index 4f05e5e51..f57a606a7 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h @@ -30,7 +30,7 @@ private: Level* level; public: - TheEndLevelRandomLevelSource(Level* level, __int64 seed); + TheEndLevelRandomLevelSource(Level* level, int64_t seed); ~TheEndLevelRandomLevelSource(); void prepareHeights(int xOffs, int zOffs, byteArray blocks,