refactor: nuke __int64/__uint64 in Minecraft.World

This commit is contained in:
Tropical 2026-03-21 17:10:36 -05:00
parent 8036565022
commit 357fca24aa
117 changed files with 251 additions and 251 deletions

View file

@ -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<Toggle>* toggles = recentToggles[level];
if (toggles != NULL) {

View file

@ -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);
};

View file

@ -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; }

View file

@ -772,7 +772,7 @@ public:
std::shared_ptr<Player> 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);

View file

@ -21,7 +21,7 @@ public:
static void staticCtor();
private:
__int64 clientSideRenderTick;
int64_t clientSideRenderTick;
float clientSideRenderScale;
bool isActive;

View file

@ -22,7 +22,7 @@ private:
bool m_costsChanged; // 4J Added
public:
__int64 nameSeed;
int64_t nameSeed;
public:
int costs[3];

View file

@ -14,7 +14,7 @@ private:
int life;
public:
__int64 seed;
int64_t seed;
private:
int flashes;

View file

@ -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;

View file

@ -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) {

View file

@ -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) {

View file

@ -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<milliseconds>(
fileTime - fs::file_time_type::clock::now() + system_clock::now());
return static_cast<__int64>(systemTime.time_since_epoch().count());
return static_cast<int64_t>(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<int64_t>(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<int64_t>(fileStat.st_mtime);
} else {
return 0l;
}

View file

@ -26,8 +26,8 @@ public:
std::vector<File*>* listFiles() const; // Array
std::vector<File*>* 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;

View file

@ -99,7 +99,7 @@ public:
unsigned int regionIndex; // 4B
};
__int64 lastModifiedTime; // 8B
int64_t lastModifiedTime; // 8B
};
typedef FileEntrySaveDataV2 FileEntrySaveData;

View file

@ -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<int64_t>(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<int64_t>(0, end - start));
const int64_t target = start + offset;
if (!FileSeek(m_fileHandle, target, SEEK_SET)) {
return 0;
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -20,7 +20,7 @@ private:
int fileSlotMapLength;
std::vector<int> freeFileSlots;
int totalFileSlots;
static __int64 largest;
static int64_t largest;
public:
NbtSlotFile(File file);

View file

@ -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;

View file

@ -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

View file

@ -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<int64_t>(buffer[m_position]);
int64_t b2 = static_cast<int64_t>(buffer[m_position + 1]);
int64_t b3 = static_cast<int64_t>(buffer[m_position + 2]);
int64_t b4 = static_cast<int64_t>(buffer[m_position + 3]);
int64_t b5 = static_cast<int64_t>(buffer[m_position + 4]);
int64_t b6 = static_cast<int64_t>(buffer[m_position + 5]);
int64_t b7 = static_cast<int64_t>(buffer[m_position + 6]);
int64_t b8 = static_cast<int64_t>(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) {

View file

@ -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();

View file

@ -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;

View file

@ -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); }

View file

@ -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);
};

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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; };
};

View file

@ -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);
};

View file

@ -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<lightCache_t*>(LevelTlsGetValue(tlsIdxLightCache));
__uint64 cacheUse = 0;
uint64_t cacheUse = 0;
if (force) {
// 4J - special mode added so we can do lava lighting updates without

View file

@ -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)) ^

View file

@ -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()) {

View file

@ -14,7 +14,7 @@ private:
ConsoleSaveFile* m_saveFile;
static CRITICAL_SECTION cs_memory;
std::unordered_map<__int64, byteArray> m_entityData;
std::unordered_map<int64_t, byteArray> m_entityData;
static std::deque<DataOutputStream*> s_chunkDataQueue;
static int s_runningThreadCount;

View file

@ -306,7 +306,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level,
std::vector<TickNextTickData>* ticksInChunk =
level->fetchTicksInChunk(lc, false);
if (ticksInChunk != NULL) {
__int64 levelTime = level->getTime();
int64_t levelTime = level->getTime();
ListTag<CompoundTag>* tickTags = new ListTag<CompoundTag>();
for (int i = 0; i < ticksInChunk->size(); i++) {
@ -405,7 +405,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level, CompoundTag* tag) {
std::vector<TickNextTickData>* ticksInChunk =
level->fetchTicksInChunk(lc, false);
if (ticksInChunk != NULL) {
__int64 levelTime = level->getTime();
int64_t levelTime = level->getTime();
ListTag<CompoundTag>* tickTags = new ListTag<CompoundTag>();
for (int i = 0; i < ticksInChunk->size(); i++) {

View file

@ -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));

View file

@ -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,

View file

@ -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;

View file

@ -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:

View file

@ -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) {

View file

@ -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);

View file

@ -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
{

View file

@ -5,10 +5,10 @@
class SetTimePacket : public Packet,
public std::enable_shared_from_this<SetTimePacket> {
public:
__int64 time;
int64_t time;
SetTimePacket();
SetTimePacket(__int64 time);
SetTimePacket(int64_t time);
virtual void read(DataInputStream* dis);
virtual void write(DataOutputStream* dos);

View file

@ -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() {}

View file

@ -63,7 +63,7 @@ void System::arraycopy(arrayWithLength<int> 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;

View file

@ -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);
};

View file

@ -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

View file

@ -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

View file

@ -181,7 +181,7 @@ private:
bool m_isRunning;
bool m_hasStarted;
int m_exitCode;
__int64 m_lastSleepTime;
int64_t m_lastSleepTime;
static std::vector<C4JThread*> ms_threadList;
static CRITICAL_SECTION ms_threadListCS;

View file

@ -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 {

View file

@ -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

View file

@ -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);

View file

@ -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,

View file

@ -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;
}

View file

@ -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);

View file

@ -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<int64_t>(offset), origin) == 0;
#else
return fseeko(file, static_cast<off_t>(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<int64_t>(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};

View file

@ -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);
}

View file

@ -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();
};

View file

@ -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 {

View file

@ -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<int64_t, Block*, LongKeyHash, LongKeyEq>
cached; // 4J - was LongHashMap
std::vector<Block*> all; // was ArrayList<Block>

View file

@ -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(

View file

@ -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();

View file

@ -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;

View file

@ -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) {

View file

@ -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,

View file

@ -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<TilePos*> toRemove;

View file

@ -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,

View file

@ -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,

View file

@ -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++) {

View file

@ -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());

View file

@ -14,7 +14,7 @@ public:
};
protected:
std::unordered_map<__int64, StructureStart*> cachedStructures;
std::unordered_map<int64_t, StructureStart*> cachedStructures;
public:
~StructureFeature();

View file

@ -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<Layer> parent)
AddIslandLayer::AddIslandLayer(int64_t seedMixup, std::shared_ptr<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;
}

View file

@ -4,7 +4,7 @@
class AddIslandLayer : public Layer {
public:
AddIslandLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
AddIslandLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;

View file

@ -3,6 +3,6 @@
class AddMushroomIslandLayer : public Layer {
public:
AddMushroomIslandLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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<Layer> parent)
AddSnowLayer::AddSnowLayer(int64_t seedMixup, std::shared_ptr<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;
}

View file

@ -3,6 +3,6 @@
class AddSnowLayer : public Layer {
public:
AddSnowLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
AddSnowLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -4,7 +4,7 @@
#include "../../Headers/net.minecraft.world.level.h"
#include "BiomeInitLayer.h"
BiomeInitLayer::BiomeInitLayer(__int64 seed, std::shared_ptr<Layer> parent,
BiomeInitLayer::BiomeInitLayer(int64_t seed, std::shared_ptr<Layer> parent,
LevelType* levelType)
: Layer(seed) {
this->parent = parent;

View file

@ -9,7 +9,7 @@ private:
BiomeArray startBiomes;
public:
BiomeInitLayer(__int64 seed, std::shared_ptr<Layer> parent,
BiomeInitLayer(int64_t seed, std::shared_ptr<Layer> parent,
LevelType* levelType);
virtual ~BiomeInitLayer();
intArray getArea(int xo, int yo, int w, int h);

View file

@ -2,7 +2,7 @@
#include "../../Platform/System.h"
#include "../../Headers/net.minecraft.world.level.newbiome.layer.h"
FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, std::shared_ptr<Layer> parent)
FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr<Layer> 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<Layer> FuzzyZoomLayer::zoom(__int64 seed,
std::shared_ptr<Layer> FuzzyZoomLayer::zoom(int64_t seed,
std::shared_ptr<Layer> sup,
int count) {
std::shared_ptr<Layer> result = sup;

View file

@ -4,7 +4,7 @@
class FuzzyZoomLayer : public Layer {
public:
FuzzyZoomLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr<Layer> 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<Layer> zoom(__int64 seed, std::shared_ptr<Layer> sup,
static std::shared_ptr<Layer> zoom(int64_t seed, std::shared_ptr<Layer> sup,
int count);
};

View file

@ -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<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;

View file

@ -3,6 +3,6 @@
class GrowMushroomIslandLayer : public Layer {
public:
GrowMushroomIslandLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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);

View file

@ -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);
};

View file

@ -16,7 +16,7 @@ libdivide::divider<long long> fast_d7(7);
libdivide::divider<long long> 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;

View file

@ -10,23 +10,23 @@ class LevelType;
class Layer {
private:
__int64 seed;
int64_t seed;
protected:
std::shared_ptr<Layer> 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);

View file

@ -3,7 +3,7 @@
#include "../../Util/IntCache.h"
#include "RegionHillsLayer.h"
RegionHillsLayer::RegionHillsLayer(__int64 seed, std::shared_ptr<Layer> parent)
RegionHillsLayer::RegionHillsLayer(int64_t seed, std::shared_ptr<Layer> parent)
: Layer(seed) {
this->parent = parent;
}

View file

@ -4,7 +4,7 @@
class RegionHillsLayer : public Layer {
public:
RegionHillsLayer(__int64 seed, std::shared_ptr<Layer> parent);
RegionHillsLayer(int64_t seed, std::shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -1,7 +1,7 @@
#include "../../Platform/stdafx.h"
#include "../../Headers/net.minecraft.world.level.newbiome.layer.h"
RiverInitLayer::RiverInitLayer(__int64 seed, std::shared_ptr<Layer> parent)
RiverInitLayer::RiverInitLayer(int64_t seed, std::shared_ptr<Layer> parent)
: Layer(seed) {
this->parent = parent;
}

View file

@ -4,7 +4,7 @@
class RiverInitLayer : public Layer {
public:
RiverInitLayer(__int64 seed, std::shared_ptr<Layer> parent);
RiverInitLayer(int64_t seed, std::shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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<Layer> parent)
RiverLayer::RiverLayer(int64_t seedMixup, std::shared_ptr<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;
}

View file

@ -4,6 +4,6 @@
class RiverLayer : public Layer {
public:
RiverLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
RiverLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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<Layer> biomes,
RiverMixerLayer::RiverMixerLayer(int64_t seed, std::shared_ptr<Layer> biomes,
std::shared_ptr<Layer> 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);

View file

@ -8,9 +8,9 @@ private:
std::shared_ptr<Layer> rivers;
public:
RiverMixerLayer(__int64 seed, std::shared_ptr<Layer> biomes,
RiverMixerLayer(int64_t seed, std::shared_ptr<Layer> biomes,
std::shared_ptr<Layer> rivers);
virtual void init(__int64 seed);
virtual void init(int64_t seed);
virtual intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -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<Layer> parent)
ShoreLayer::ShoreLayer(int64_t seed, std::shared_ptr<Layer> parent)
: Layer(seed) {
this->parent = parent;
}

View file

@ -3,6 +3,6 @@
class ShoreLayer : public Layer {
public:
ShoreLayer(__int64 seed, std::shared_ptr<Layer> parent);
ShoreLayer(int64_t seed, std::shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
};

View file

@ -1,7 +1,7 @@
#include "../../Platform/stdafx.h"
#include "../../Headers/net.minecraft.world.level.newbiome.layer.h"
SmoothLayer::SmoothLayer(__int64 seedMixup, std::shared_ptr<Layer> parent)
SmoothLayer::SmoothLayer(int64_t seedMixup, std::shared_ptr<Layer> parent)
: Layer(seedMixup) {
this->parent = parent;
}

View file

@ -4,7 +4,7 @@
class SmoothLayer : public Layer {
public:
SmoothLayer(__int64 seedMixup, std::shared_ptr<Layer> parent);
SmoothLayer(int64_t seedMixup, std::shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
};

Some files were not shown because too many files have changed in this diff Show more