diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp index 88ed4d6b1..0a7987b1b 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp @@ -334,14 +334,15 @@ __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)((xStart>>4)<<4) + 16); + // 4jcraft changed >>4<<4 to & ~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)((zStart>>4)<<4) + 16); + int zEnd = std::min(destinationBox->z1, (double)(zStart & ~15) + 16); int rowBlocksIncluded = (yEnd-yStart)*(zEnd-zStart); int blocksIncluded = (xEnd-xStart)*rowBlocksIncluded; diff --git a/Minecraft.World/Level/TickNextTickData.cpp b/Minecraft.World/Level/TickNextTickData.cpp index 4baacd7ad..292fea72e 100644 --- a/Minecraft.World/Level/TickNextTickData.cpp +++ b/Minecraft.World/Level/TickNextTickData.cpp @@ -30,7 +30,8 @@ bool TickNextTickData::equals(const void *o) const int TickNextTickData::hashCode() const { - return (((x * 1024 * 1024) + (z * 1024) + y) * 256) + tileId; + // 4jcraft added cast to unsigned + return ((((unsigned) x * 1024 * 1024) + ((unsigned) z * 1024) + (unsigned) y) * 256) + tileId; } TickNextTickData *TickNextTickData::delay(__int64 l) @@ -66,4 +67,4 @@ int TickNextTickData::hash_fnct(const TickNextTickData &k) bool TickNextTickData::eq_test(const TickNextTickData &x, const TickNextTickData &y) { return ( x.x == y.x ) && ( x.y == y.y ) && ( x.z == y.z ) && ( x.tileId == y.tileId ); -} \ No newline at end of file +}