mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-21 05:15:48 +00:00
refactor: modernize AABB class
This commit is contained in:
@@ -83,14 +83,13 @@ void BaseMobSpawner::tick() {
|
||||
EntityIO::newEntity(getEntityId(), getLevel());
|
||||
if (entity == NULL) return;
|
||||
|
||||
int nearBy =
|
||||
getLevel()
|
||||
->getEntitiesOfClass(
|
||||
typeid(entity.get()),
|
||||
AABB::newTemp(getX(), getY(), getZ(), getX() + 1,
|
||||
getY() + 1, getZ() + 1)
|
||||
->grow(spawnRange * 2, 4, spawnRange * 2))
|
||||
->size();
|
||||
AABB grown =
|
||||
AABB(getX(), getY(), getZ(), getX() + 1, getY() + 1, getZ() + 1)
|
||||
.grow(spawnRange * 2, 4, spawnRange * 2);
|
||||
|
||||
int nearBy = getLevel()
|
||||
->getEntitiesOfClass(typeid(entity.get()), &grown)
|
||||
->size();
|
||||
if (nearBy >= maxNearbyEntities) {
|
||||
delay();
|
||||
return;
|
||||
@@ -359,4 +358,4 @@ CompoundTag* BaseMobSpawner::SpawnData::save() {
|
||||
result->putInt(L"Weight", randomWeight);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user