Use BYTE Win Typedef instead of byte typedef from Minecraft.World

This commit is contained in:
GabsPuNs
2026-05-10 21:03:03 -04:00
parent 20d395b88d
commit 3e7983ab3c
216 changed files with 798 additions and 800 deletions

View File

@@ -531,7 +531,7 @@ void LevelChunk::recalcHeightmapOnly()
blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks;
}
#endif
heightmap[z << 4 | x] = static_cast<byte>(y);
heightmap[z << 4 | x] = static_cast<BYTE>(y);
if (y < min) min = y;
}
@@ -588,7 +588,7 @@ void LevelChunk::recalcHeightmap()
blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks;
}
#endif
heightmap[z << 4 | x] = static_cast<byte>(y);
heightmap[z << 4 | x] = static_cast<BYTE>(y);
if (y < min) min = y;
if (y < lowestHeightmap) lowestHeightmap = y;
@@ -811,7 +811,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z)
if (y == yOld) return;
// level->lightColumnChanged(x, z, y, yOld); // 4J - this call moved below & corrected - see comment further down
heightmap[z << 4 | x] = static_cast<byte>(y);
heightmap[z << 4 | x] = static_cast<BYTE>(y);
if (y < minHeight)
{
@@ -919,7 +919,7 @@ int LevelChunk::getTile(int x, int y, int z)
bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data)
{
byte tile = static_cast<byte>(_tile);
BYTE tile = static_cast<BYTE>(_tile);
// Optimisation brought forward from 1.8.2, change from int to unsigned char & this special value changed from -999 to 255
int slot = z << 4 | x;
@@ -2072,7 +2072,7 @@ void LevelChunk::reloadBiomes()
for(unsigned int z = 0; z < 16; ++z)
{
Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z);
biomes[(z << 4) | x] = static_cast<byte>((biome->id) & 0xff);
biomes[(z << 4) | x] = static_cast<BYTE>((biome->id) & 0xff);
}
}
}
@@ -2084,7 +2084,7 @@ Biome *LevelChunk::getBiome(int x, int z, BiomeSource *biomeSource)
{
Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z);
value = biome->id;
biomes[(z << 4) | x] = static_cast<byte>(value & 0xff);
biomes[(z << 4) | x] = static_cast<BYTE>(value & 0xff);
}
if (Biome::biomes[value] == nullptr)
{
@@ -2171,14 +2171,14 @@ void LevelChunk::updateBiomeFlags(int x, int z)
}
}
// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set;
// Get a BYTE array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set;
void LevelChunk::getDataData(byteArray data)
{
lowerData->getData(data,0);
if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2);
}
// Set data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set.
// Set data to data passed in input BYTE array of length 16384. This data must be in original (java version) order if originalOrder set.
void LevelChunk::setDataData(byteArray data)
{
if( lowerData == nullptr ) lowerData = new SparseDataStorage();
@@ -2187,21 +2187,21 @@ void LevelChunk::setDataData(byteArray data)
if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2);
}
// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set;
// Get a BYTE array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set;
void LevelChunk::getSkyLightData(byteArray data)
{
lowerSkyLight->getData(data,0);
if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2);
}
// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set;
// Get a BYTE array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set;
void LevelChunk::getBlockLightData(byteArray data)
{
lowerBlockLight->getData(data,0);
if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperBlockLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2);
}
// Set sky light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set.
// Set sky light data to data passed in input BYTE array of length 16384. This data must be in original (java version) order if originalOrder set.
void LevelChunk::setSkyLightData(byteArray data)
{
if( lowerSkyLight == nullptr ) lowerSkyLight = new SparseLightStorage(true);
@@ -2210,7 +2210,7 @@ void LevelChunk::setSkyLightData(byteArray data)
if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2);
}
// Set block light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set.
// Set block light data to data passed in input BYTE array of length 16384. This data must be in original (java version) order if originalOrder set.
void LevelChunk::setBlockLightData(byteArray data)
{
if( lowerBlockLight == nullptr ) lowerBlockLight = new SparseLightStorage(false);