mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-25 10:53:51 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
0f97ed95ea
1392 changed files with 22843 additions and 21062 deletions
|
|
@ -118,7 +118,7 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie
|
|||
// 4J - rewritten to add chunks interleaved by player, and to add them from the centre outwards. We're going to be
|
||||
// potentially adding less creatures than the original so that our count stays consistent with number of players added, so
|
||||
// we want to make sure as best we can that the ones we do add are near the active players
|
||||
int playerCount = (int)level->players.size();
|
||||
int playerCount = static_cast<int>(level->players.size());
|
||||
int *xx = new int[playerCount];
|
||||
int *zz = new int[playerCount];
|
||||
for (int i = 0; i < playerCount; i++)
|
||||
|
|
@ -261,8 +261,8 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie
|
|||
int z = zStart;
|
||||
int ss = 6;
|
||||
|
||||
Biome::MobSpawnerData *currentMobType = NULL;
|
||||
MobGroupData *groupData = NULL;
|
||||
Biome::MobSpawnerData *currentMobType = nullptr;
|
||||
MobGroupData *groupData = nullptr;
|
||||
|
||||
for (int ll = 0; ll < 4; ll++)
|
||||
{
|
||||
|
|
@ -277,9 +277,9 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie
|
|||
if (isSpawnPositionOk(mobCategory, level, x, y, z))
|
||||
{
|
||||
float xx = x + 0.5f;
|
||||
float yy = (float) y;
|
||||
float yy = static_cast<float>(y);
|
||||
float zz = z + 0.5f;
|
||||
if (level->getNearestPlayer(xx, yy, zz, MIN_SPAWN_DISTANCE) != NULL)
|
||||
if (level->getNearestPlayer(xx, yy, zz, MIN_SPAWN_DISTANCE) != nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -295,10 +295,10 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie
|
|||
}
|
||||
}
|
||||
|
||||
if (currentMobType == NULL)
|
||||
if (currentMobType == nullptr)
|
||||
{
|
||||
currentMobType = level->getRandomMobSpawnAt(mobCategory, x, y, z);
|
||||
if (currentMobType == NULL)
|
||||
if (currentMobType == nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ void MobSpawner::postProcessSpawnMobs(Level *level, Biome *biome, int xo, int zo
|
|||
while (random->nextFloat() < biome->getCreatureProbability())
|
||||
{
|
||||
Biome::MobSpawnerData *type = (Biome::MobSpawnerData *) WeighedRandom::getRandomItem(level->random, ((vector<WeighedRandomItem *> *)mobs));
|
||||
MobGroupData *groupData = NULL;
|
||||
MobGroupData *groupData = nullptr;
|
||||
int count = type->minCount + random->nextInt(1 + type->maxCount - type->minCount);
|
||||
|
||||
int x = xo + random->nextInt(cellWidth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue