77#include < typeinfo>
88#include < vector>
99
10+ #include " llapi/mc/WeakEntityRef.hpp"
1011#include " llapi/mc/ActorDamageSource.hpp"
1112#include " llapi/mc/BaseCommandBlock.hpp"
1213#include " llapi/mc/BedrockBlocks.hpp"
3233#include " llapi/mc/PlayerActionPacket.hpp"
3334#include " llapi/mc/RespawnPacket.hpp"
3435#include " llapi/mc/Scoreboard.hpp"
35- #include " llapi/mc/NpcSceneDialogueData.hpp"
3636#include " llapi/mc/ArmorStand.hpp"
37- #include " llapi/mc/NpcComponent.hpp"
3837#include " llapi/mc/Container.hpp"
3938#include " llapi/mc/ScoreboardId.hpp"
4039#include " llapi/mc/ServerNetworkHandler.hpp"
@@ -268,7 +267,6 @@ DECLARE_EVENT_DATA(ProjectileHitEntityEvent);
268267DECLARE_EVENT_DATA (WitherBossDestroyEvent);
269268DECLARE_EVENT_DATA (EntityRideEvent);
270269DECLARE_EVENT_DATA (EntityStepOnPressurePlateEvent);
271- DECLARE_EVENT_DATA (NpcCmdEvent);
272270DECLARE_EVENT_DATA (ProjectileSpawnEvent);
273271DECLARE_EVENT_DATA (ProjectileCreatedEvent);
274272DECLARE_EVENT_DATA (EntityTransformEvent);
@@ -1334,7 +1332,7 @@ TInstanceHook(void*, "?die@ServerPlayer@@UEAAXAEBVActorDamageSource@@@Z", Server
13341332#include " llapi/mc/SurvivalMode.hpp"
13351333
13361334// ///////////////// PlayerDestroy ///////////////////
1337- TInstanceHook (bool ," ?playerWillDestroy@BlockLegacy@@UEBA_NAEAVPlayer @@AEBVBlockPos@@AEBVBlock@@@ Z" , BlockLegacy , Player *player, const BlockPos *pos, const Block *block ){
1335+ TInstanceHook (bool ," ?playerWillDestroy@Block@@QEBA_NAEAVPlayer @@AEBVBlockPos@@@ Z" , Block, Player *player, const BlockPos *pos){
13381336 if (player != nullptr && player->isPlayer ()) {
13391337 IF_LISTENED (PlayerDestroyBlockEvent) {
13401338 PlayerDestroyBlockEvent ev{};
@@ -1346,7 +1344,7 @@ TInstanceHook(bool,"?playerWillDestroy@BlockLegacy@@UEBA_NAEAVPlayer@@AEBVBlockP
13461344 }
13471345 IF_LISTENED_END (PlayerDestroyBlockEvent)
13481346 }
1349- return original (this , player, pos, block );
1347+ return original (this , player, pos);
13501348}
13511349
13521350// TInstanceHook(bool, "?destroyBlock@SurvivalMode@@UEAA_NAEBVBlockPos@@E@Z", GameMode, BlockPos blockPos,
@@ -1842,40 +1840,6 @@ TClasslessInstanceHook(void, "?releaseUsing@TridentItem@@UEBAXAEAVItemStack@@PEA
18421840 return original (this , a2, a3, a4);
18431841}
18441842
1845- #include " llapi/mc/WeakEntityRef.hpp"
1846- #include " llapi/mc/EntityContext.hpp"
1847- #include " llapi/mc/Npc.hpp"
1848-
1849- // //////////// NpcCmd //////////////
1850- TInstanceHook (void ,
1851- " ?executeCommandAction@NpcComponent@@QEAAXAEAVActor@@AEAVPlayer@@HAEBV?$basic_string@DU?$char_traits@D@"
1852- " std@@V?$allocator@D@2@@std@@@Z" ,
1853- NpcComponent, Actor* ac, Player* player, int a4, string& a5) {
1854- IF_LISTENED (NpcCmdEvent) {
1855- // IDA NpcComponent::executeCommandAction
1856- // NpcSceneDialogueData data(*this, *ac, a5);
1857-
1858- NpcSceneDialogueData data (WeakEntityRef (ac->getEntityContext ().getWeakRef ()), a5);
1859-
1860- auto container = data.getActionsContainer ();
1861- if (container) {
1862- auto actionAt = container->at (a4);
1863- if (actionAt) {
1864- if (auto * command = std::get_if<npc::CommandAction>(actionAt)) {
1865- NpcCmdEvent ev{};
1866- ev.mPlayer = player;
1867- ev.mNpc = ac;
1868- ev.mCommand = command->mActionValue .mText ;
1869- if (!ev.call ())
1870- return ;
1871- }
1872- }
1873- }
1874- }
1875- IF_LISTENED_END (NpcCmdEvent)
1876- return original (this , ac, player, a4, a5);
1877- }
1878-
18791843// //////////// ArmorStandChange //////////////
18801844TInstanceHook (bool , " ?_trySwapItem@ArmorStand@@AEAA_NAEAVPlayer@@W4EquipmentSlot@@@Z" , ArmorStand, Player* a2, int a3) {
18811845 IF_LISTENED (ArmorStandChangeEvent) {
0 commit comments