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

"byte" wasnt working anymore for some reason
This commit is contained in:
GabsPuNs
2026-04-13 17:54:28 -04:00
parent e90e585ef0
commit 40d48948ff
233 changed files with 4751 additions and 930 deletions

View File

@@ -104,7 +104,7 @@ void HellRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray block
tileId = Tile::netherRack_Id;
}
blocks[offs] = static_cast<byte>(tileId);
blocks[offs] = static_cast<BYTE>(tileId);
offs += step;
val += vala;
}
@@ -147,8 +147,8 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
int run = -1;
byte top = (byte) Tile::netherRack_Id;
byte material = (byte) Tile::netherRack_Id;
BYTE top = (BYTE) Tile::netherRack_Id;
BYTE material = (BYTE) Tile::netherRack_Id;
for (int y = Level::genDepthMinusOne; y >= 0; y--)
{
@@ -160,7 +160,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
{
if( z - random->nextInt( 4 ) <= 0 || xOffs < -(m_XZSize/2) )
{
blocks[offs] = static_cast<byte>(Tile::unbreakable_Id);
blocks[offs] = static_cast<BYTE>(Tile::unbreakable_Id);
blockSet = true;
}
}
@@ -168,7 +168,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
{
if( x - random->nextInt( 4 ) <= 0 || zOffs < -(m_XZSize/2))
{
blocks[offs] = static_cast<byte>(Tile::unbreakable_Id);
blocks[offs] = static_cast<BYTE>(Tile::unbreakable_Id);
blockSet = true;
}
}
@@ -176,7 +176,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
{
if( z + random->nextInt(4) >= 15 || xOffs > (m_XZSize/2))
{
blocks[offs] = static_cast<byte>(Tile::unbreakable_Id);
blocks[offs] = static_cast<BYTE>(Tile::unbreakable_Id);
blockSet = true;
}
}
@@ -184,7 +184,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
{
if( x + random->nextInt(4) >= 15 || zOffs > (m_XZSize/2) )
{
blocks[offs] = static_cast<byte>(Tile::unbreakable_Id);
blocks[offs] = static_cast<BYTE>(Tile::unbreakable_Id);
blockSet = true;
}
}
@@ -193,7 +193,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
if (y >= Level::genDepthMinusOne - random->nextInt(5) || y <= 0 + random->nextInt(5))
{
blocks[offs] = static_cast<byte>(Tile::unbreakable_Id);
blocks[offs] = static_cast<BYTE>(Tile::unbreakable_Id);
}
else
{
@@ -210,20 +210,20 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
if (runDepth <= 0)
{
top = 0;
material = static_cast<byte>(Tile::netherRack_Id);
material = static_cast<BYTE>(Tile::netherRack_Id);
}
else if (y >= waterHeight - 4 && y <= waterHeight + 1)
{
top = static_cast<byte>(Tile::netherRack_Id);
material = static_cast<byte>(Tile::netherRack_Id);
if (gravel) top = static_cast<byte>(Tile::gravel_Id);
if (gravel) material = static_cast<byte>(Tile::netherRack_Id);
top = static_cast<BYTE>(Tile::netherRack_Id);
material = static_cast<BYTE>(Tile::netherRack_Id);
if (gravel) top = static_cast<BYTE>(Tile::gravel_Id);
if (gravel) material = static_cast<BYTE>(Tile::netherRack_Id);
if (sand)
{
// 4J Stu - Make some nether wart spawn outside of the nether fortresses
if(random->nextInt(16) == 0)
{
top = static_cast<byte>(Tile::netherStalk_Id);
top = static_cast<BYTE>(Tile::netherStalk_Id);
// Place the nether wart on top of the soul sand
y += 1;
@@ -234,13 +234,13 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks
}
else
{
top = static_cast<byte>(Tile::soulsand_Id);
top = static_cast<BYTE>(Tile::soulsand_Id);
}
}
if (sand) material = static_cast<byte>(Tile::soulsand_Id);
if (sand) material = static_cast<BYTE>(Tile::soulsand_Id);
}
if (y < waterHeight && top == 0) top = static_cast<byte>(Tile::calmLava_Id);
if (y < waterHeight && top == 0) top = static_cast<BYTE>(Tile::calmLava_Id);
run = runDepth;
// 4J Stu - If sand, then allow adding nether wart at heights below the water level
@@ -273,7 +273,7 @@ LevelChunk *HellRandomLevelSource::getChunk(int xOffs, int zOffs)
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
int blocksSize = Level::genDepth * 16 * 16;
byte *tileData = static_cast<byte *>(XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE));
BYTE *tileData = static_cast<BYTE *>(XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE));
XMemSet128(tileData,0,blocksSize);
byteArray blocks = byteArray(tileData,blocksSize);
// byteArray blocks = byteArray(16 * level->depth * 16);