From 5aef20e37e73fa5d4d31e2681662e7648b0e7c77 Mon Sep 17 00:00:00 2001 From: Nikita Edel Date: Wed, 11 Mar 2026 14:13:32 +0100 Subject: [PATCH] fixed rounding, mb --- .../Platform/Common/GameRules/ConsoleSchematicFile.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp index da54f7194..88ed4d6b1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp @@ -194,15 +194,15 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos) __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = std::max(destinationBox->x0, (double)chunk->x*16); - // 4jcraft added cast to u - int xEnd = std::min(destinationBox->x1, (double)((unsigned) (xStart>>4)<<4) + 16); + // 4jcraft changed from (xStart>>4)<<4 to (xStart & ~15) + int xEnd = std::min(destinationBox->x1, (double)((xStart & ~15) + 16)); int yStart = destinationBox->y0; int yEnd = destinationBox->y1; if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight; int zStart = std::max(destinationBox->z0, (double)chunk->z*16); - int zEnd = std::min(destinationBox->z1, (double)(((unsigned) zStart>>4)<<4) + 16); + int zEnd = std::min(destinationBox->z1, (double)(zStart & ~15) + 16); #ifdef _DEBUG app.DebugPrintf("Range is (%d,%d,%d) to (%d,%d,%d)\n",xStart,yStart,zStart,xEnd-1,yEnd-1,zEnd-1); @@ -334,14 +334,14 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB __int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = std::max(destinationBox->x0, (double)chunk->x*16); - int xEnd = std::min(destinationBox->x1, (double)(((unsigned) xStart>>4)<<4) + 16); + int xEnd = std::min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); int yStart = destinationBox->y0; int yEnd = destinationBox->y1; if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight; int zStart = std::max(destinationBox->z0, (double)chunk->z*16); - int zEnd = std::min(destinationBox->z1, (double)(((unsigned) zStart>>4)<<4) + 16); + int zEnd = std::min(destinationBox->z1, (double)((zStart>>4)<<4) + 16); int rowBlocksIncluded = (yEnd-yStart)*(zEnd-zStart); int blocksIncluded = (xEnd-xStart)*rowBlocksIncluded;