refactor: modernize AABB class
This commit is contained in:
1 parent
da7cbcb4b6
commit
79217ca8e3
53 files changed
+362
-357
No files matched your search
@@ -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