Skip to content

Commit ebe60f5

Browse files
committed
fix: fix onLiquidFlow
1 parent c0304af commit ebe60f5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/legacy/api/EventAPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,7 @@ void EnableEventListener(int eventId) {
640640
break;
641641

642642
case EVENT_TYPES::onLiquidFlow:
643-
// TODO:
644-
// lse::events::LiquidFlowEvent();
643+
lse::events::LiquidFlowEvent();
645644
break;
646645

647646
case EVENT_TYPES::onUseFrameBlock:

src/lse/events/EventHooks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "mc/world/scores/ServerScoreboard.h"
7373
#include "mc/world/level/Explosion.h"
7474
#include "mc/world/events/PlayerOpenContainerEvent.h"
75+
#include "mc/world/level/material/Material.h"
7576

7677
namespace lse::events {
7778

@@ -759,7 +760,6 @@ LL_TYPE_INSTANCE_HOOK(
759760
origin(region, pos, strength, isFirstTime);
760761
}
761762

762-
// TODO: It is broken, need to be fixed
763763
LL_TYPE_INSTANCE_HOOK(
764764
LiquidFlowHook,
765765
HookPriority::Normal,
@@ -775,7 +775,7 @@ LL_TYPE_INSTANCE_HOOK(
775775
IF_LISTENED(EVENT_TYPES::onLiquidFlow) {
776776
if (!CallEvent(
777777
EVENT_TYPES::onLiquidFlow,
778-
BlockClass::newBlock(pos, region.getDimensionId()),
778+
region.isInstaticking(pos) ? Local<Value>() : BlockClass::newBlock(pos, region.getDimensionId()),
779779
IntPos::newPos(pos, region.getDimensionId())
780780
)) {
781781
return;

0 commit comments

Comments
 (0)