aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StructureFeature.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:53:32 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:53:32 +0700
commitd63f79325f85e014361eb8cf1e41eaebedb1ae71 (patch)
treed9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/StructureFeature.cpp
parentd6ec138710461294c3ffd2723bc8a9f212d3471f (diff)
Get rid of MSVC's __int64
Use either int64_t, uint64_t or long long and unsigned long long, defined as per C++11 standard
Diffstat (limited to 'Minecraft.World/StructureFeature.cpp')
-rw-r--r--Minecraft.World/StructureFeature.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/Minecraft.World/StructureFeature.cpp b/Minecraft.World/StructureFeature.cpp
index 5e8489f0..9a204d00 100644
--- a/Minecraft.World/StructureFeature.cpp
+++ b/Minecraft.World/StructureFeature.cpp
@@ -92,16 +92,16 @@ bool StructureFeature::isIntersection(int cellX, int cellZ)
///////////////////////////////////////////
// 4J-PB - Below functions added from 1.2.3
///////////////////////////////////////////
-bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ)
+bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ)
{
- //for (StructureStart structureStart : cachedStructures.values())
+ //for (StructureStart structureStart : cachedStructures.values())
for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it)
{
StructureStart *pStructureStart = it->second;
- if (pStructureStart->isValid())
+ if (pStructureStart->isValid())
{
- if (pStructureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ))
+ if (pStructureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ))
{
/*
Iterator<StructurePiece> it = structureStart.getPieces().iterator();
@@ -127,7 +127,7 @@ bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ)
return false;
}
-TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ)
+TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ)
{
// this is a hack that will "force" the feature to generate positions
@@ -135,10 +135,10 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
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());
@@ -150,7 +150,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
{
StructureStart *pStructureStart = it->second;
- if (pStructureStart->isValid())
+ if (pStructureStart->isValid())
{
//StructurePiece *pStructurePiece = pStructureStart->getPieces().get(0);
@@ -162,21 +162,21 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
int dz = locatorPosition->z - cellZ;
double dist = dx + dx * dy * dy + dz * dz;
- if (dist < minDistance)
+ if (dist < minDistance)
{
minDistance = dist;
selected = locatorPosition;
}
}
}
- if (selected != NULL)
+ if (selected != NULL)
{
return selected;
- }
- else
+ }
+ else
{
vector<TilePos> *guesstimatedFeaturePositions = getGuesstimatedFeaturePositions();
- if (guesstimatedFeaturePositions != NULL)
+ if (guesstimatedFeaturePositions != NULL)
{
TilePos *pSelectedPos = new TilePos(0,0,0);
@@ -187,7 +187,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
int dz = (*it).z - cellZ;
double dist = dx + dx * dy * dy + dz * dz;
- if (dist < minDistance)
+ if (dist < minDistance)
{
minDistance = dist;
pSelectedPos->x = (*it).x;
@@ -202,7 +202,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
return NULL;
}
-vector<TilePos> *StructureFeature::getGuesstimatedFeaturePositions()
+vector<TilePos> *StructureFeature::getGuesstimatedFeaturePositions()
{
return NULL;
}