1515#include " mc/world/level/ChunkBlockPos.h"
1616#include " mc/world/level/block/BedrockBlockNames.h"
1717#include " mc/world/level/block/Block.h"
18+ #include " mc/world/level/block/BlockChangeContext.h"
1819#include " mc/world/level/block/LiquidReaction.h"
1920#include " mc/world/level/block/VanillaBlockTags.h"
2021#include " mc/world/level/block/actor/BlockActor.h"
@@ -297,7 +298,8 @@ Local<Value> BlockClass::destroyBlock(const Arguments& args) {
297298 BlockSource& bl =
298299 ll::service::getLevel ()->getDimension (blockPos.dim ).lock ()->getBlockSourceFromMainChunkSource ();
299300 return Boolean::newBoolean (
300- ll::service::getLevel ()->destroyBlock (bl, blockPos.getBlockPos (), args[0 ].asBoolean ().value ())
301+ ll::service::getLevel ()
302+ ->destroyBlock (bl, blockPos.getBlockPos (), args[0 ].asBoolean ().value (), BlockChangeContext ())
301303 );
302304 }
303305 CATCH (" Fail in destroyBlock!" );
@@ -325,7 +327,7 @@ Local<Value> BlockClass::setNbt(const Arguments& args) {
325327 ->getDimension (blockPos.dim )
326328 .lock ()
327329 ->getBlockSourceFromMainChunkSource ()
328- .setBlock (blockPos.getBlockPos (), *bl, 3 , nullptr , nullptr );
330+ .setBlock (blockPos.getBlockPos (), *bl, 3 , nullptr , nullptr , BlockChangeContext () );
329331 }
330332 preloadData (blockPos.getBlockPos (), blockPos.getDimensionId ());
331333 return Boolean::newBoolean (true );
@@ -533,7 +535,7 @@ Local<Value> McClass::setBlock(const Arguments& args) {
533535 }
534536 BlockSource& bs =
535537 ll::service::getLevel ()->getDimension (pos.dim ).lock ()->getBlockSourceFromMainChunkSource ();
536- return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), bl, 3 , nullptr , nullptr ));
538+ return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), bl, 3 , nullptr , nullptr , BlockChangeContext () ));
537539 } else if (IsInstanceOf<NbtCompoundClass>(block)) {
538540 // Nbt
539541 auto nbt = NbtCompoundClass::extract (block);
@@ -543,7 +545,7 @@ Local<Value> McClass::setBlock(const Arguments& args) {
543545 }
544546 BlockSource& bs =
545547 ll::service::getLevel ()->getDimension (pos.dim ).lock ()->getBlockSourceFromMainChunkSource ();
546- return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), bl, 3 , nullptr , nullptr ));
548+ return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), bl, 3 , nullptr , nullptr , BlockChangeContext () ));
547549 } else {
548550 // other block object
549551 Block const * bl = BlockClass::extract (block);
@@ -553,7 +555,7 @@ Local<Value> McClass::setBlock(const Arguments& args) {
553555 }
554556 BlockSource& bs =
555557 ll::service::getLevel ()->getDimension (pos.dim ).lock ()->getBlockSourceFromMainChunkSource ();
556- return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), *bl, 3 , nullptr , nullptr ));
558+ return Boolean::newBoolean (bs.setBlock (pos.getBlockPos (), *bl, 3 , nullptr , nullptr , BlockChangeContext () ));
557559 }
558560 }
559561 CATCH (" Fail in SetBlock!" )
0 commit comments