Skip to content

Commit 1c7b71f

Browse files
committed
fix: fix return type for invalid dimension in mc.getBlock
1 parent e4af655 commit 1c7b71f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/legacy/api/BlockAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,14 @@ Local<Value> McClass::getBlock(const Arguments& args) {
423423
if (IsInstanceOf<IntPos>(args[0])) {
424424
// IntPos
425425
IntPos* posObj = IntPos::extractPos(args[0]);
426-
if (posObj->dim < 0) return Boolean::newBoolean(false);
426+
if (posObj->dim < 0) return {};
427427
else {
428428
pos = *posObj;
429429
}
430430
} else if (IsInstanceOf<FloatPos>(args[0])) {
431431
// FloatPos
432432
FloatPos* posObj = FloatPos::extractPos(args[0]);
433-
if (posObj->dim < 0) return Boolean::newBoolean(false);
433+
if (posObj->dim < 0) return {};
434434
else {
435435
pos = posObj->toIntVec4();
436436
}

0 commit comments

Comments
 (0)