Skip to content

Commit 3492116

Browse files
committed
fix: fix range parameter of mc.getEntities
1 parent 47bb404 commit 3492116

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/legacy/api/EntityAPI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,8 @@ Local<Value> McClass::getEntities(const Arguments& args) {
15731573
LOG_TOO_FEW_ARGS(__FUNCTION__);
15741574
return Local<Value>();
15751575
}
1576+
aabb.max += dis;
1577+
aabb.min -= dis;
15761578

15771579
auto arr = Array::newArray();
15781580
auto dimension = ll::service::getLevel()->getDimension(dim);
@@ -1581,7 +1583,7 @@ Local<Value> McClass::getEntities(const Arguments& args) {
15811583
return Local<Value>();
15821584
}
15831585
BlockSource& bs = dimension.lock()->getBlockSourceFromMainChunkSource();
1584-
auto entityList = bs.getEntities(aabb, dis);
1586+
auto entityList = bs.getEntities(aabb);
15851587
for (auto i : entityList) {
15861588
arr.add(EntityClass::newEntity(i));
15871589
}

0 commit comments

Comments
 (0)