Skip to content

Commit 26eaa19

Browse files
committed
fix: fix getEnderChest #99
1 parent 64276c6 commit 26eaa19

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/legacy/api/PlayerAPI.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include "mc/world/ActorUniqueID.h"
6363
#include "mc/world/Container.h"
6464
#include "mc/world/Minecraft.h"
65+
#include "mc/world/actor/player/EnderChestContainer.h"
6566
#include "mc/world/actor/player/PlayerScoreSetFunction.h"
6667
#include "mc/world/actor/player/PlayerUISlot.h"
6768
#include "mc/world/effect/MobEffectInstance.h"
@@ -1638,8 +1639,15 @@ Local<Value> PlayerClass::getEnderChest(const Arguments& args) {
16381639
if (chest) {
16391640
return ContainerClass::newContainer(chest);
16401641
} else {
1641-
return {};
1642+
EnderChestContainer* enderChest = ll::memory::dAccess<EnderChestContainer*>(
1643+
player,
1644+
3248
1645+
); // Todo: please remove it when LeviLamina 0.11.1 released
1646+
if (enderChest) {
1647+
return ContainerClass::newContainer(chest);
1648+
}
16421649
}
1650+
return {};
16431651
}
16441652
CATCH("Fail in getEnderChest!");
16451653
}

0 commit comments

Comments
 (0)