mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-05 03:43:40 +00:00
注释掉没有符号的EventAPI和其余部分,虽然是残血版中的残血版,至少能用不是吗?
This commit is contained in:
parent
88629b7ead
commit
8d10dc3c56
@ -133,11 +133,12 @@ inline void handle(class NetworkIdentifier const& a0, class EmotePacket const& a
|
|||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVEmotePacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVEmotePacket@@@Z");
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class EmotePacket const&>(a1));
|
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class EmotePacket const&>(a1));
|
||||||
}
|
}
|
||||||
inline void handle(class NetworkIdentifier const& a0, class FilterTextPacket const& a1) {
|
// 没有这个符号
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class FilterTextPacket const&);
|
// inline void handle(class NetworkIdentifier const& a0, class FilterTextPacket const& a1) {
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVFilterTextPacket@@@Z");
|
// void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class FilterTextPacket const&);
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class FilterTextPacket const&>(a1));
|
// *((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVFilterTextPacket@@@Z");
|
||||||
}
|
// return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class FilterTextPacket const&>(a1));
|
||||||
|
// }
|
||||||
inline void handle(class NetworkIdentifier const& a0, class InteractPacket const& a1) {
|
inline void handle(class NetworkIdentifier const& a0, class InteractPacket const& a1) {
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class InteractPacket const&);
|
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class InteractPacket const&);
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVInteractPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVInteractPacket@@@Z");
|
||||||
@ -228,11 +229,12 @@ inline void handle(class NetworkIdentifier const& a0, class NpcRequestPacket con
|
|||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVNpcRequestPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVNpcRequestPacket@@@Z");
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class NpcRequestPacket const&>(a1));
|
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class NpcRequestPacket const&>(a1));
|
||||||
}
|
}
|
||||||
inline void handle(class NetworkIdentifier const& a0, class PassengerJumpPacket const& a1) {
|
// 没有这个符号
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class PassengerJumpPacket const&);
|
// inline void handle(class NetworkIdentifier const& a0, class PassengerJumpPacket const& a1) {
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVPassengerJumpPacket@@@Z");
|
// void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class PassengerJumpPacket const&);
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class PassengerJumpPacket const&>(a1));
|
// *((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVPassengerJumpPacket@@@Z");
|
||||||
}
|
// return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class PassengerJumpPacket const&>(a1));
|
||||||
|
// }
|
||||||
inline void handle(class NetworkIdentifier const& a0, class PlayerActionPacket const& a1) {
|
inline void handle(class NetworkIdentifier const& a0, class PlayerActionPacket const& a1) {
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class PlayerActionPacket const&);
|
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class PlayerActionPacket const&);
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVPlayerActionPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVPlayerActionPacket@@@Z");
|
||||||
@ -328,11 +330,12 @@ inline void handle(class NetworkIdentifier const& a0, class StructureTemplateDat
|
|||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVStructureTemplateDataRequestPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVStructureTemplateDataRequestPacket@@@Z");
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class StructureTemplateDataRequestPacket const&>(a1));
|
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class StructureTemplateDataRequestPacket const&>(a1));
|
||||||
}
|
}
|
||||||
inline void handle(class NetworkIdentifier const& a0, class SubChunkRequestPacket const& a1) {
|
// 1.16没有subChunkPacket
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class SubChunkRequestPacket const&);
|
// inline void handle(class NetworkIdentifier const& a0, class SubChunkRequestPacket const& a1) {
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVSubChunkRequestPacket@@@Z");
|
// void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class SubChunkRequestPacket const&);
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class SubChunkRequestPacket const&>(a1));
|
// *((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVSubChunkRequestPacket@@@Z");
|
||||||
}
|
// return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class SubChunkRequestPacket const&>(a1));
|
||||||
|
// }
|
||||||
inline void handle(class NetworkIdentifier const& a0, class SubClientLoginPacket const& a1) {
|
inline void handle(class NetworkIdentifier const& a0, class SubClientLoginPacket const& a1) {
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class SubClientLoginPacket const&);
|
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class SubClientLoginPacket const&);
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVSubClientLoginPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVSubClientLoginPacket@@@Z");
|
||||||
@ -353,12 +356,12 @@ inline void handle(class NetworkIdentifier const& a0, class std::shared_ptr<clas
|
|||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@V?$shared_ptr@VBlockActorDataPacket@@@std@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@V?$shared_ptr@VBlockActorDataPacket@@@std@@@Z");
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class std::shared_ptr<class BlockActorDataPacket>>(a1));
|
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class std::shared_ptr<class BlockActorDataPacket>>(a1));
|
||||||
}
|
}
|
||||||
|
// 没有这个符号
|
||||||
inline void handle(class NetworkIdentifier const& a0, class CreatePhotoPacket const& a1) {
|
// inline void handle(class NetworkIdentifier const& a0, class CreatePhotoPacket const& a1) {
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class CreatePhotoPacket const&);
|
// void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class CreatePhotoPacket const&);
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCreatePhotoPacket@@@Z");
|
// *((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCreatePhotoPacket@@@Z");
|
||||||
return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class CreatePhotoPacket const&>(a1));
|
// return (this->*rv)(std::forward<class NetworkIdentifier const&>(a0), std::forward<class CreatePhotoPacket const&>(a1));
|
||||||
}
|
// }
|
||||||
inline void handle(class NetworkIdentifier const& a0, class CompletedUsingItemPacket const& a1) {
|
inline void handle(class NetworkIdentifier const& a0, class CompletedUsingItemPacket const& a1) {
|
||||||
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class CompletedUsingItemPacket const&);
|
void (ServerNetworkHandler:: * rv)(class NetworkIdentifier const&, class CompletedUsingItemPacket const&);
|
||||||
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCompletedUsingItemPacket@@@Z");
|
*((void**)&rv) = dlsym("?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCompletedUsingItemPacket@@@Z");
|
||||||
|
@ -321,32 +321,34 @@ TClasslessInstanceHook(void, "?sendLoginMessageLocal@ServerNetworkHandler@@QEAAX
|
|||||||
|
|
||||||
|
|
||||||
/////////////////// PlayerJoin ///////////////////
|
/////////////////// PlayerJoin ///////////////////
|
||||||
TInstanceHook(bool, "?setLocalPlayerAsInitialized@ServerPlayer@@QEAAXXZ",
|
//没有这个符号
|
||||||
ServerPlayer) {
|
// TInstanceHook(bool, "?setLocalPlayerAsInitialized@ServerPlayer@@QEAAXXZ",
|
||||||
IF_LISTENED(PlayerJoinEvent) {
|
// ServerPlayer) {
|
||||||
PlayerJoinEvent ev{};
|
// IF_LISTENED(PlayerJoinEvent) {
|
||||||
ev.mPlayer = this;
|
// PlayerJoinEvent ev{};
|
||||||
|
// ev.mPlayer = this;
|
||||||
|
|
||||||
if (!ev.call())
|
// if (!ev.call())
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerJoinEvent)
|
// IF_LISTENED_END(PlayerJoinEvent)
|
||||||
return original(this);
|
// return original(this);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/////////////////// PlayerLeft ///////////////////
|
/////////////////// PlayerLeft ///////////////////
|
||||||
THook(void, "?disconnect@ServerPlayer@@QEAAXXZ",
|
//符号没有
|
||||||
ServerPlayer* sp) {
|
// THook(void, "?disconnect@ServerPlayer@@QEAAXXZ",
|
||||||
IF_LISTENED(PlayerLeftEvent) {
|
// ServerPlayer* sp) {
|
||||||
PlayerLeftEvent ev{};
|
// IF_LISTENED(PlayerLeftEvent) {
|
||||||
ev.mPlayer = sp;
|
// PlayerLeftEvent ev{};
|
||||||
ev.mXUID = sp->getXuid();
|
// ev.mPlayer = sp;
|
||||||
ev.call();
|
// ev.mXUID = sp->getXuid();
|
||||||
}
|
// ev.call();
|
||||||
IF_LISTENED_END(PlayerLeftEvent)
|
// }
|
||||||
return original(sp);
|
// IF_LISTENED_END(PlayerLeftEvent)
|
||||||
}
|
// return original(sp);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerRespawn ///////////////////
|
/////////////////// PlayerRespawn ///////////////////
|
||||||
TClasslessInstanceHook(void, "?handle@?$PacketHandlerDispatcherInstance@VPlayerActionPacket@@$0A@@@UEBAXAEBVNetworkIdentifier@@AEAVNetEventCallback@@AEAV?$shared_ptr@VPacket@@@std@@@Z",
|
TClasslessInstanceHook(void, "?handle@?$PacketHandlerDispatcherInstance@VPlayerActionPacket@@$0A@@@UEBAXAEBVNetworkIdentifier@@AEAVNetEventCallback@@AEAV?$shared_ptr@VPacket@@@std@@@Z",
|
||||||
@ -396,22 +398,23 @@ public:
|
|||||||
std::unique_ptr<CompoundTag> mAgentTag;
|
std::unique_ptr<CompoundTag> mAgentTag;
|
||||||
};
|
};
|
||||||
|
|
||||||
TClasslessInstanceHook(bool, "?requestPlayerChangeDimension@Level@@UEAAXAEAVPlayer@@V?$unique_ptr@VChangeDimensionRequest@@U?$default_delete@VChangeDimensionRequest@@@std@@@std@@@Z",
|
//没有这个符号
|
||||||
Player* sp, std::unique_ptr<ChangeDimensionRequest> request) {
|
// TClasslessInstanceHook(bool, "?requestPlayerChangeDimension@Level@@UEAAXAEAVPlayer@@V?$unique_ptr@VChangeDimensionRequest@@U?$default_delete@VChangeDimensionRequest@@@std@@@std@@@Z",
|
||||||
|
// Player* sp, std::unique_ptr<ChangeDimensionRequest> request) {
|
||||||
|
|
||||||
if (request->mToDimensionId == sp->getDimensionId())
|
// if (request->mToDimensionId == sp->getDimensionId())
|
||||||
return original(this, sp, std::move(request));
|
// return original(this, sp, std::move(request));
|
||||||
|
|
||||||
IF_LISTENED(PlayerChangeDimEvent) {
|
// IF_LISTENED(PlayerChangeDimEvent) {
|
||||||
PlayerChangeDimEvent ev{};
|
// PlayerChangeDimEvent ev{};
|
||||||
ev.mPlayer = sp;
|
// ev.mPlayer = sp;
|
||||||
ev.mToDimensionId = request->mToDimensionId;
|
// ev.mToDimensionId = request->mToDimensionId;
|
||||||
if (!ev.call())
|
// if (!ev.call())
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerChangeDimEvent)
|
// IF_LISTENED_END(PlayerChangeDimEvent)
|
||||||
return original(this, sp, std::move(request));
|
// return original(this, sp, std::move(request));
|
||||||
}
|
// }
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
/////////////////// PlayerJump ///////////////////
|
/////////////////// PlayerJump ///////////////////
|
||||||
@ -426,53 +429,56 @@ TInstanceHook(void, "?jumpFromGround@Player@@UEAAXXZ", Player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// PlayerSneak ///////////////////
|
/////////////////// PlayerSneak ///////////////////
|
||||||
TClasslessInstanceHook(void, "?sendActorSneakChanged@ActorEventCoordinator@@QEAAXAEAVActor@@_N@Z",
|
//没有这个符号
|
||||||
Actor* ac, bool isSneaking) {
|
// TClasslessInstanceHook(void, "?sendActorSneakChanged@ActorEventCoordinator@@QEAAXAEAVActor@@_N@Z",
|
||||||
IF_LISTENED(PlayerSneakEvent) {
|
// Actor* ac, bool isSneaking) {
|
||||||
PlayerSneakEvent ev{};
|
// IF_LISTENED(PlayerSneakEvent) {
|
||||||
ev.mPlayer = (Player*)ac;
|
// PlayerSneakEvent ev{};
|
||||||
ev.mIsSneaking = isSneaking;
|
// ev.mPlayer = (Player*)ac;
|
||||||
ev.call();
|
// ev.mIsSneaking = isSneaking;
|
||||||
|
// ev.call();
|
||||||
|
|
||||||
isSneaking = ev.mIsSneaking;
|
// isSneaking = ev.mIsSneaking;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerSneakEvent)
|
// IF_LISTENED_END(PlayerSneakEvent)
|
||||||
return original(this, ac, isSneaking);
|
// return original(this, ac, isSneaking);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/////////////////// PlayerAttackEntity ///////////////////
|
/////////////////// PlayerAttackEntity ///////////////////
|
||||||
TInstanceHook(bool, "?attack@Player@@UEAA_NAEAVActor@@AEBW4ActorDamageCause@@@Z",
|
//没有这个符号
|
||||||
Player, Actor* ac, int* damageCause) {
|
// TInstanceHook(bool, "?attack@Player@@UEAA_NAEAVActor@@AEBW4ActorDamageCause@@@Z",
|
||||||
IF_LISTENED(PlayerAttackEvent) {
|
// Player, Actor* ac, int* damageCause) {
|
||||||
PlayerAttackEvent ev{};
|
// IF_LISTENED(PlayerAttackEvent) {
|
||||||
ev.mPlayer = this;
|
// PlayerAttackEvent ev{};
|
||||||
ev.mTarget = ac;
|
// ev.mPlayer = this;
|
||||||
ev.mAttackDamage = *damageCause;
|
// ev.mTarget = ac;
|
||||||
if (!ev.call())
|
// ev.mAttackDamage = *damageCause;
|
||||||
return false;
|
// if (!ev.call())
|
||||||
|
// return false;
|
||||||
|
|
||||||
ac = ev.mTarget;
|
// ac = ev.mTarget;
|
||||||
*damageCause = ev.mAttackDamage;
|
// *damageCause = ev.mAttackDamage;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerAttackEvent)
|
// IF_LISTENED_END(PlayerAttackEvent)
|
||||||
return original(this, ac, damageCause);
|
// return original(this, ac, damageCause);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerAttackBlock ///////////////////
|
/////////////////// PlayerAttackBlock ///////////////////
|
||||||
TInstanceHook(bool, "?attack@Block@@QEBA_NPEAVPlayer@@AEBVBlockPos@@@Z",
|
//没有这个符号
|
||||||
Block, Player* pl, BlockPos* bp) {
|
// TInstanceHook(bool, "?attack@Block@@QEBA_NPEAVPlayer@@AEBVBlockPos@@@Z",
|
||||||
IF_LISTENED(PlayerAttackBlockEvent) {
|
// Block, Player* pl, BlockPos* bp) {
|
||||||
PlayerAttackBlockEvent ev{};
|
// IF_LISTENED(PlayerAttackBlockEvent) {
|
||||||
ev.mPlayer = pl;
|
// PlayerAttackBlockEvent ev{};
|
||||||
ev.mItemStack = pl->getHandSlot();
|
// ev.mPlayer = pl;
|
||||||
ev.mBlockInstance = BlockInstance::createBlockInstance(this, *bp, pl->getDimensionId());
|
// ev.mItemStack = pl->getHandSlot();
|
||||||
if (!ev.call())
|
// ev.mBlockInstance = BlockInstance::createBlockInstance(this, *bp, pl->getDimensionId());
|
||||||
return false;
|
// if (!ev.call())
|
||||||
}
|
// return false;
|
||||||
IF_LISTENED_END(PlayerAttackBlockEvent)
|
// }
|
||||||
return original(this, pl, bp);
|
// IF_LISTENED_END(PlayerAttackBlockEvent)
|
||||||
}
|
// return original(this, pl, bp);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerTakeItem ///////////////////
|
/////////////////// PlayerTakeItem ///////////////////
|
||||||
TInstanceHook(bool, "?take@Player@@QEAA_NAEAVActor@@HH@Z",
|
TInstanceHook(bool, "?take@Player@@QEAA_NAEAVActor@@HH@Z",
|
||||||
@ -552,51 +558,54 @@ TInstanceHook(void, "?onEffectRemoved@ServerPlayer@@MEAAXAEAVMobEffectInstance@@
|
|||||||
return original(this, effect);
|
return original(this, effect);
|
||||||
}
|
}
|
||||||
// update
|
// update
|
||||||
TInstanceHook(void, "?onEffectUpdated@ServerPlayer@@MEAAXAEAVMobEffectInstance@@@Z", Player, MobEffectInstance* effect) {
|
// 没有这个符号
|
||||||
IF_LISTENED(PlayerEffectChangedEvent) {
|
// TInstanceHook(void, "?onEffectUpdated@ServerPlayer@@MEAAXAEAVMobEffectInstance@@@Z", Player, MobEffectInstance* effect) {
|
||||||
PlayerEffectChangedEvent ev{};
|
// IF_LISTENED(PlayerEffectChangedEvent) {
|
||||||
ev.mPlayer = this;
|
// PlayerEffectChangedEvent ev{};
|
||||||
ev.mEventType = PlayerEffectChangedEvent::EventType::Update;
|
// ev.mPlayer = this;
|
||||||
ev.mEffect = effect;
|
// ev.mEventType = PlayerEffectChangedEvent::EventType::Update;
|
||||||
ev.call();
|
// ev.mEffect = effect;
|
||||||
}
|
// ev.call();
|
||||||
IF_LISTENED_END(PlayerEffectChangedEvent)
|
// }
|
||||||
return original(this, effect);
|
// IF_LISTENED_END(PlayerEffectChangedEvent)
|
||||||
}
|
// return original(this, effect);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/////////////////// PlayerStartDestroyBlock ///////////////////
|
/////////////////// PlayerStartDestroyBlock ///////////////////
|
||||||
TClasslessInstanceHook(void, "?sendBlockDestructionStarted@BlockEventCoordinator@@QEAAXAEAVPlayer@@AEBVBlockPos@@@Z",
|
// 没有这个符号
|
||||||
Player* pl, BlockPos* bp) {
|
// TClasslessInstanceHook(void, "?sendBlockDestructionStarted@BlockEventCoordinator@@QEAAXAEAVPlayer@@AEBVBlockPos@@@Z",
|
||||||
IF_LISTENED(PlayerStartDestroyBlockEvent) {
|
// Player* pl, BlockPos* bp) {
|
||||||
PlayerStartDestroyBlockEvent ev{};
|
// IF_LISTENED(PlayerStartDestroyBlockEvent) {
|
||||||
ev.mPlayer = pl;
|
// PlayerStartDestroyBlockEvent ev{};
|
||||||
ev.mBlockInstance = Level::getBlockInstance(bp, Level::getBlockSource(pl));
|
// ev.mPlayer = pl;
|
||||||
ev.call();
|
// ev.mBlockInstance = Level::getBlockInstance(bp, Level::getBlockSource(pl));
|
||||||
}
|
// ev.call();
|
||||||
IF_LISTENED_END(PlayerStartDestroyBlockEvent)
|
// }
|
||||||
return original(this, pl, bp);
|
// IF_LISTENED_END(PlayerStartDestroyBlockEvent)
|
||||||
}
|
// return original(this, pl, bp);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerPlaceBlock ///////////////////
|
/////////////////// PlayerPlaceBlock ///////////////////
|
||||||
#include <MC/ItemUseInventoryTransaction.hpp>
|
#include <MC/ItemUseInventoryTransaction.hpp>
|
||||||
TInstanceHook(char, "?checkBlockPermissions@BlockSource@@QEAA_NAEAVActor@@AEBVBlockPos@@EAEBVItemStackBase@@_N@Z",
|
// 没有这个符号
|
||||||
BlockSource, Actor* ac, BlockPos* bp, unsigned __int8 facing, ItemStackBase* item, bool a6) {
|
// TInstanceHook(char, "?checkBlockPermissions@BlockSource@@QEAA_NAEAVActor@@AEBVBlockPos@@EAEBVItemStackBase@@_N@Z",
|
||||||
if (ac->isPlayer()) {
|
// BlockSource, Actor* ac, BlockPos* bp, unsigned __int8 facing, ItemStackBase* item, bool a6) {
|
||||||
IF_LISTENED(PlayerPlaceBlockEvent) {
|
// if (ac->isPlayer()) {
|
||||||
auto pl = (Player*)ac;
|
// IF_LISTENED(PlayerPlaceBlockEvent) {
|
||||||
PlayerPlaceBlockEvent ev{};
|
// auto pl = (Player*)ac;
|
||||||
ev.mPlayer = pl;
|
// PlayerPlaceBlockEvent ev{};
|
||||||
ev.mBlockInstance = this->getBlockInstance(*bp);
|
// ev.mPlayer = pl;
|
||||||
if (!ev.call()) { // this pointer is not used.
|
// ev.mBlockInstance = this->getBlockInstance(*bp);
|
||||||
((ItemUseInventoryTransaction*)nullptr)->resendBlocksAroundArea(*pl, *bp, facing);
|
// if (!ev.call()) { // this pointer is not used.
|
||||||
return false;
|
// ((ItemUseInventoryTransaction*)nullptr)->resendBlocksAroundArea(*pl, *bp, facing);
|
||||||
}
|
// return false;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerPlaceBlockEvent)
|
// }
|
||||||
}
|
// IF_LISTENED_END(PlayerPlaceBlockEvent)
|
||||||
return original(this, ac, bp, facing, item, a6);
|
// }
|
||||||
}
|
// return original(this, ac, bp, facing, item, a6);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// BlockPlacedByPlayerEvent ///////////////////
|
/////////////////// BlockPlacedByPlayerEvent ///////////////////
|
||||||
TClasslessInstanceHook(void, "?sendBlockPlacedByPlayer@BlockEventCoordinator@@QEAAXAEAVPlayer@@AEBVBlock@@AEBVBlockPos@@_N@Z",
|
TClasslessInstanceHook(void, "?sendBlockPlacedByPlayer@BlockEventCoordinator@@QEAAXAEAVPlayer@@AEBVBlock@@AEBVBlockPos@@_N@Z",
|
||||||
@ -887,22 +896,23 @@ TInstanceHook(bool, "?useOn@SeedItemComponentLegacy@@QEAA_NAEAVItemStack@@AEAVAc
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/////////////////// PlayerOpenContainer ///////////////////
|
/////////////////// PlayerOpenContainer ///////////////////
|
||||||
TClasslessInstanceHook(__int64, "?onEvent@VanillaServerGameplayEventListener@@UEAA?AW4EventResult@@AEBUPlayerOpenContainerEvent@@@Z", void* a2) {
|
// 没有这个符号
|
||||||
Actor* pl = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ", Actor*, void*)(a2);
|
// TClasslessInstanceHook(__int64, "?onEvent@VanillaServerGameplayEventListener@@UEAA?AW4EventResult@@AEBUPlayerOpenContainerEvent@@@Z", void* a2) {
|
||||||
if (pl->isPlayer()) {
|
// Actor* pl = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ", Actor*, void*)(a2);
|
||||||
IF_LISTENED(PlayerOpenContainerEvent) {
|
// if (pl->isPlayer()) {
|
||||||
BlockPos bp = dAccess<BlockPos>(a2, 28);
|
// IF_LISTENED(PlayerOpenContainerEvent) {
|
||||||
PlayerOpenContainerEvent ev{};
|
// BlockPos bp = dAccess<BlockPos>(a2, 28);
|
||||||
ev.mPlayer = (Player*)pl;
|
// PlayerOpenContainerEvent ev{};
|
||||||
ev.mBlockInstance = Level::getBlockInstance(bp, pl->getDimensionId());
|
// ev.mPlayer = (Player*)pl;
|
||||||
ev.mContainer = ev.mBlockInstance.getContainer();
|
// ev.mBlockInstance = Level::getBlockInstance(bp, pl->getDimensionId());
|
||||||
if (!ev.call())
|
// ev.mContainer = ev.mBlockInstance.getContainer();
|
||||||
return 0;
|
// if (!ev.call())
|
||||||
}
|
// return 0;
|
||||||
IF_LISTENED_END(PlayerOpenContainerEvent)
|
// }
|
||||||
}
|
// IF_LISTENED_END(PlayerOpenContainerEvent)
|
||||||
return original(this, a2);
|
// }
|
||||||
}
|
// return original(this, a2);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerCloseContainer ///////////////////
|
/////////////////// PlayerCloseContainer ///////////////////
|
||||||
// chest
|
// chest
|
||||||
@ -956,19 +966,20 @@ TInstanceHook(void, "?inventoryChanged@Player@@UEAAXAEAVContainer@@HAEBVItemStac
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// PlayerMove ///////////////////
|
/////////////////// PlayerMove ///////////////////
|
||||||
TClasslessInstanceHook(void, "?sendPlayerMove@PlayerEventCoordinator@@QEAAXAEAVPlayer@@@Z",
|
// 没有这个符号
|
||||||
Player* pl) {
|
// TClasslessInstanceHook(void, "?sendPlayerMove@PlayerEventCoordinator@@QEAAXAEAVPlayer@@@Z",
|
||||||
IF_LISTENED(PlayerMoveEvent) {
|
// Player* pl) {
|
||||||
if (pl->isMoving()) {
|
// IF_LISTENED(PlayerMoveEvent) {
|
||||||
PlayerMoveEvent ev{};
|
// if (pl->isMoving()) {
|
||||||
ev.mPlayer = pl;
|
// PlayerMoveEvent ev{};
|
||||||
ev.mPos = pl->getPosition();
|
// ev.mPlayer = pl;
|
||||||
ev.call();
|
// ev.mPos = pl->getPosition();
|
||||||
}
|
// ev.call();
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerMoveEvent)
|
// }
|
||||||
return original(this, pl);
|
// IF_LISTENED_END(PlayerMoveEvent)
|
||||||
}
|
// return original(this, pl);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// PlayerSprint ///////////////////
|
/////////////////// PlayerSprint ///////////////////
|
||||||
TInstanceHook(void, "?setSprinting@Mob@@UEAAX_N@Z",
|
TInstanceHook(void, "?setSprinting@Mob@@UEAAX_N@Z",
|
||||||
@ -1168,34 +1179,36 @@ TClasslessInstanceHook(unsigned short,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////// BlockChanged ///////////////////
|
/////////////////// BlockChanged ///////////////////
|
||||||
TInstanceHook(void, "?_blockChanged@BlockSource@@IEAAXAEBVBlockPos@@IAEBVBlock@@1HPEBUActorBlockSyncMessage@@PEAVActor@@@Z",
|
// 没有这个符号
|
||||||
BlockSource, BlockPos* bp, int a3, Block* afterBlock, Block* beforeBlock, int a6, void* a7, Actor* ac) {
|
// TInstanceHook(void, "?_blockChanged@BlockSource@@IEAAXAEBVBlockPos@@IAEBVBlock@@1HPEBUActorBlockSyncMessage@@PEAVActor@@@Z",
|
||||||
IF_LISTENED(BlockChangedEvent) {
|
// BlockSource, BlockPos* bp, int a3, Block* afterBlock, Block* beforeBlock, int a6, void* a7, Actor* ac) {
|
||||||
int dimId = this->getDimensionId();
|
// IF_LISTENED(BlockChangedEvent) {
|
||||||
BlockChangedEvent ev{};
|
// int dimId = this->getDimensionId();
|
||||||
ev.mPreviousBlockInstance = BlockInstance::createBlockInstance(beforeBlock, *bp, dimId);
|
// BlockChangedEvent ev{};
|
||||||
ev.mNewBlockInstance = BlockInstance::createBlockInstance(afterBlock, *bp, dimId);
|
// ev.mPreviousBlockInstance = BlockInstance::createBlockInstance(beforeBlock, *bp, dimId);
|
||||||
if (!ev.call())
|
// ev.mNewBlockInstance = BlockInstance::createBlockInstance(afterBlock, *bp, dimId);
|
||||||
return;
|
// if (!ev.call())
|
||||||
}
|
// return;
|
||||||
IF_LISTENED_END(BlockChangedEvent)
|
// }
|
||||||
return original(this, bp, a3, afterBlock, beforeBlock, a6, a7, ac);
|
// IF_LISTENED_END(BlockChangedEvent)
|
||||||
}
|
// return original(this, bp, a3, afterBlock, beforeBlock, a6, a7, ac);
|
||||||
|
// }
|
||||||
|
|
||||||
/////////////////// BlockExploded ///////////////////
|
/////////////////// BlockExploded ///////////////////
|
||||||
TInstanceHook(void, "?onExploded@Block@@QEBAXAEAVBlockSource@@AEBVBlockPos@@PEAVActor@@@Z",
|
// 没有这个符号
|
||||||
Block, BlockSource* bs, BlockPos* bp, Actor* actor) {
|
// TInstanceHook(void, "?onExploded@Block@@QEBAXAEAVBlockSource@@AEBVBlockPos@@PEAVActor@@@Z",
|
||||||
IF_LISTENED(BlockExplodedEvent) {
|
// Block, BlockSource* bs, BlockPos* bp, Actor* actor) {
|
||||||
if (actor) {
|
// IF_LISTENED(BlockExplodedEvent) {
|
||||||
BlockExplodedEvent ev{};
|
// if (actor) {
|
||||||
ev.mBlockInstance = BlockInstance::createBlockInstance(this, *bp, bs->getDimensionId());
|
// BlockExplodedEvent ev{};
|
||||||
ev.mExplodeSource = actor;
|
// ev.mBlockInstance = BlockInstance::createBlockInstance(this, *bp, bs->getDimensionId());
|
||||||
ev.call();
|
// ev.mExplodeSource = actor;
|
||||||
}
|
// ev.call();
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(BlockExplodedEvent)
|
// }
|
||||||
return original(this, bs, bp, actor);
|
// IF_LISTENED_END(BlockExplodedEvent)
|
||||||
}
|
// return original(this, bs, bp, actor);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/////////////////// FireSpread ///////////////////
|
/////////////////// FireSpread ///////////////////
|
||||||
@ -1254,26 +1267,27 @@ TClasslessInstanceHook(bool, "?mayPlace@FireBlock@@UEBA_NAEAVBlockSource@@AEBVBl
|
|||||||
|
|
||||||
|
|
||||||
/////////////////// ProjectileHitBlock ///////////////////
|
/////////////////// ProjectileHitBlock ///////////////////
|
||||||
TInstanceHook(void, "?onProjectileHit@Block@@QEBAXAEAVBlockSource@@AEBVBlockPos@@AEBVActor@@@Z",
|
// 没有这个符号
|
||||||
Block, BlockSource* bs, BlockPos* bp, Actor* actor) {
|
// TInstanceHook(void, "?onProjectileHit@Block@@QEBAXAEAVBlockSource@@AEBVBlockPos@@AEBVActor@@@Z",
|
||||||
// Exclude default position BlockPos::Zero
|
// Block, BlockSource* bs, BlockPos* bp, Actor* actor) {
|
||||||
if ((bp->x | bp->y | bp->z) == 0) // actor->getPos().distanceTo(bp->center())>5)
|
// // Exclude default position BlockPos::Zero
|
||||||
return original(this, bs, bp, actor);
|
// if ((bp->x | bp->y | bp->z) == 0) // actor->getPos().distanceTo(bp->center())>5)
|
||||||
IF_LISTENED(ProjectileHitBlockEvent) {
|
// return original(this, bs, bp, actor);
|
||||||
if (this->getTypeName() != "minecraft:air") {
|
// IF_LISTENED(ProjectileHitBlockEvent) {
|
||||||
ProjectileHitBlockEvent ev{};
|
// if (this->getTypeName() != "minecraft:air") {
|
||||||
ev.mBlockInstance = Level::getBlockInstance(bp, bs);
|
// ProjectileHitBlockEvent ev{};
|
||||||
ev.mSource = actor;
|
// ev.mBlockInstance = Level::getBlockInstance(bp, bs);
|
||||||
ev.call();
|
// ev.mSource = actor;
|
||||||
}
|
// ev.call();
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(ProjectileHitBlockEvent)
|
// }
|
||||||
return original(this, bs, bp, actor);
|
// IF_LISTENED_END(ProjectileHitBlockEvent)
|
||||||
}
|
// return original(this, bs, bp, actor);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/////////////////// RedStoneUpdate ///////////////////
|
/////////////////// RedStoneUpdate ///////////////////
|
||||||
// 红石<E7BAA2>?
|
// 红石<E7BAA2>??
|
||||||
TClasslessInstanceHook(void, "?onRedstoneUpdate@RedStoneWireBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
TClasslessInstanceHook(void, "?onRedstoneUpdate@RedStoneWireBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
||||||
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
||||||
IF_LISTENED(RedStoneUpdateEvent) {
|
IF_LISTENED(RedStoneUpdateEvent) {
|
||||||
@ -1305,7 +1319,7 @@ TClasslessInstanceHook(void, "?onRedstoneUpdate@RedstoneTorchBlock@@UEBAXAEAVBlo
|
|||||||
IF_LISTENED_END(RedStoneUpdateEvent)
|
IF_LISTENED_END(RedStoneUpdateEvent)
|
||||||
return original(this, bs, bp, level, isActive);
|
return original(this, bs, bp, level, isActive);
|
||||||
}
|
}
|
||||||
// 红石中继<E4B8AD>?
|
// 红石中继<E4B8AD>??
|
||||||
TClasslessInstanceHook(void, "?onRedstoneUpdate@DiodeBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
TClasslessInstanceHook(void, "?onRedstoneUpdate@DiodeBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
||||||
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
||||||
IF_LISTENED(RedStoneUpdateEvent) {
|
IF_LISTENED(RedStoneUpdateEvent) {
|
||||||
@ -1321,7 +1335,7 @@ TClasslessInstanceHook(void, "?onRedstoneUpdate@DiodeBlock@@UEBAXAEAVBlockSource
|
|||||||
IF_LISTENED_END(RedStoneUpdateEvent)
|
IF_LISTENED_END(RedStoneUpdateEvent)
|
||||||
return original(this, bs, bp, level, isActive);
|
return original(this, bs, bp, level, isActive);
|
||||||
}
|
}
|
||||||
// 红石比较<E6AF94>?
|
// 红石比较<E6AF94>??
|
||||||
TClasslessInstanceHook(void, "?onRedstoneUpdate@ComparatorBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
TClasslessInstanceHook(void, "?onRedstoneUpdate@ComparatorBlock@@UEBAXAEAVBlockSource@@AEBVBlockPos@@H_N@Z",
|
||||||
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
BlockSource* bs, BlockPos* bp, int level, bool isActive) {
|
||||||
IF_LISTENED(RedStoneUpdateEvent) {
|
IF_LISTENED(RedStoneUpdateEvent) {
|
||||||
@ -1340,26 +1354,27 @@ TClasslessInstanceHook(void, "?onRedstoneUpdate@ComparatorBlock@@UEBAXAEAVBlockS
|
|||||||
|
|
||||||
|
|
||||||
/////////////////// HopperSearchItem ///////////////////
|
/////////////////// HopperSearchItem ///////////////////
|
||||||
TClasslessInstanceHook(bool, "?_tryPullInItemsFromAboveContainer@Hopper@@IEAA_NAEAVBlockSource@@AEAVContainer@@AEBVVec3@@@Z",
|
// 没有这个符号
|
||||||
BlockSource* bs, void* container, Vec3* pos) {
|
// TClasslessInstanceHook(bool, "?_tryPullInItemsFromAboveContainer@Hopper@@IEAA_NAEAVBlockSource@@AEAVContainer@@AEBVVec3@@@Z",
|
||||||
bool isMinecart = dAccess<bool>(this, 5); // IDA Hopper::Hopper
|
// BlockSource* bs, void* container, Vec3* pos) {
|
||||||
|
// bool isMinecart = dAccess<bool>(this, 5); // IDA Hopper::Hopper
|
||||||
|
|
||||||
IF_LISTENED(HopperSearchItemEvent) {
|
// IF_LISTENED(HopperSearchItemEvent) {
|
||||||
HopperSearchItemEvent ev{};
|
// HopperSearchItemEvent ev{};
|
||||||
if (isMinecart) {
|
// if (isMinecart) {
|
||||||
ev.isMinecart = true;
|
// ev.isMinecart = true;
|
||||||
ev.mMinecartPos = *pos;
|
// ev.mMinecartPos = *pos;
|
||||||
} else {
|
// } else {
|
||||||
ev.isMinecart = false;
|
// ev.isMinecart = false;
|
||||||
ev.mHopperBlock = Level::getBlockInstance(pos->toBlockPos(), bs);
|
// ev.mHopperBlock = Level::getBlockInstance(pos->toBlockPos(), bs);
|
||||||
}
|
// }
|
||||||
ev.mDimensionId = bs->getDimensionId();
|
// ev.mDimensionId = bs->getDimensionId();
|
||||||
if (!ev.call())
|
// if (!ev.call())
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(HopperSearchItemEvent)
|
// IF_LISTENED_END(HopperSearchItemEvent)
|
||||||
return original(this, bs, container, pos);
|
// return original(this, bs, container, pos);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/////////////////// HopperPushOut ///////////////////
|
/////////////////// HopperPushOut ///////////////////
|
||||||
TClasslessInstanceHook(bool, "?_pushOutItems@Hopper@@IEAA_NAEAVBlockSource@@AEAVContainer@@AEBVVec3@@H@Z",
|
TClasslessInstanceHook(bool, "?_pushOutItems@Hopper@@IEAA_NAEAVBlockSource@@AEAVContainer@@AEBVVec3@@H@Z",
|
||||||
@ -1426,19 +1441,20 @@ TClasslessInstanceHook(void, "?transformOnFall@FarmBlock@@UEBAXAEAVBlockSource@@
|
|||||||
|
|
||||||
|
|
||||||
/////////////////// PlayerUseFrameBlockEvent ///////////////////
|
/////////////////// PlayerUseFrameBlockEvent ///////////////////
|
||||||
TClasslessInstanceHook(bool, "?use@ItemFrameBlock@@UEBA_NAEAVPlayer@@AEBVBlockPos@@E@Z",
|
// 没有这个符号
|
||||||
Player* a2, BlockPos* a3) {
|
// TClasslessInstanceHook(bool, "?use@ItemFrameBlock@@UEBA_NAEAVPlayer@@AEBVBlockPos@@E@Z",
|
||||||
IF_LISTENED(PlayerUseFrameBlockEvent) {
|
// Player* a2, BlockPos* a3) {
|
||||||
PlayerUseFrameBlockEvent ev{};
|
// IF_LISTENED(PlayerUseFrameBlockEvent) {
|
||||||
ev.mType = PlayerUseFrameBlockEvent::Type::Use;
|
// PlayerUseFrameBlockEvent ev{};
|
||||||
ev.mBlockInstance = Level::getBlockInstance(a3, a2->getDimensionId());
|
// ev.mType = PlayerUseFrameBlockEvent::Type::Use;
|
||||||
ev.mPlayer = a2;
|
// ev.mBlockInstance = Level::getBlockInstance(a3, a2->getDimensionId());
|
||||||
if (!ev.call())
|
// ev.mPlayer = a2;
|
||||||
return false;
|
// if (!ev.call())
|
||||||
}
|
// return false;
|
||||||
IF_LISTENED_END(PlayerUseFrameBlockEvent)
|
// }
|
||||||
return original(this, a2, a3);
|
// IF_LISTENED_END(PlayerUseFrameBlockEvent)
|
||||||
}
|
// return original(this, a2, a3);
|
||||||
|
// }
|
||||||
|
|
||||||
TClasslessInstanceHook(bool, "?attack@ItemFrameBlock@@UEBA_NPEAVPlayer@@AEBVBlockPos@@@Z",
|
TClasslessInstanceHook(bool, "?attack@ItemFrameBlock@@UEBA_NPEAVPlayer@@AEBVBlockPos@@@Z",
|
||||||
Player* a2, BlockPos* a3) {
|
Player* a2, BlockPos* a3) {
|
||||||
@ -1760,53 +1776,56 @@ TClasslessInstanceHook(void, "?explode@Explosion@@QEAAXXZ") {
|
|||||||
|
|
||||||
|
|
||||||
////////////// WitherBossDestroy //////////////
|
////////////// WitherBossDestroy //////////////
|
||||||
TInstanceHook(void, "?_destroyBlocks@WitherBoss@@AEAAXAEAVLevel@@AEBVAABB@@AEAVBlockSource@@HW4WitherAttackType@1@@Z",
|
// 没有这个符号
|
||||||
Actor, Level* a2, AABB* aabb, BlockSource* a4, int a5, unsigned int a6) {
|
// TInstanceHook(void, "?_destroyBlocks@WitherBoss@@AEAAXAEAVLevel@@AEBVAABB@@AEAVBlockSource@@HW4WitherAttackType@1@@Z",
|
||||||
IF_LISTENED(WitherBossDestroyEvent) {
|
// Actor, Level* a2, AABB* aabb, BlockSource* a4, int a5, unsigned int a6) {
|
||||||
WitherBossDestroyEvent ev{};
|
// IF_LISTENED(WitherBossDestroyEvent) {
|
||||||
ev.mWitherBoss = (WitherBoss*)this;
|
// WitherBossDestroyEvent ev{};
|
||||||
ev.mDestroyRange = *aabb;
|
// ev.mWitherBoss = (WitherBoss*)this;
|
||||||
if (!ev.call())
|
// ev.mDestroyRange = *aabb;
|
||||||
return;
|
// if (!ev.call())
|
||||||
|
// return;
|
||||||
|
|
||||||
*aabb = ev.mDestroyRange;
|
// *aabb = ev.mDestroyRange;
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(WitherBossDestroyEvent)
|
// IF_LISTENED_END(WitherBossDestroyEvent)
|
||||||
original(this, a2, aabb, a4, a5, a6);
|
// original(this, a2, aabb, a4, a5, a6);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
////////////// EntityRide //////////////
|
////////////// EntityRide //////////////
|
||||||
TInstanceHook(bool, "?canAddPassenger@Actor@@UEBA_NAEAV1@@Z",
|
// 没有这个符号
|
||||||
Actor, Actor* a2) {
|
// TInstanceHook(bool, "?canAddPassenger@Actor@@UEBA_NAEAV1@@Z",
|
||||||
auto rtn = original(this, a2);
|
// Actor, Actor* a2) {
|
||||||
if (!rtn)
|
// auto rtn = original(this, a2);
|
||||||
return false;
|
// if (!rtn)
|
||||||
IF_LISTENED(EntityRideEvent) {
|
// return false;
|
||||||
EntityRideEvent ev{};
|
// IF_LISTENED(EntityRideEvent) {
|
||||||
ev.mRider = a2;
|
// EntityRideEvent ev{};
|
||||||
ev.mVehicle = this;
|
// ev.mRider = a2;
|
||||||
if (!ev.call())
|
// ev.mVehicle = this;
|
||||||
return false;
|
// if (!ev.call())
|
||||||
}
|
// return false;
|
||||||
IF_LISTENED_END(EntityRideEvent)
|
// }
|
||||||
return rtn;
|
// IF_LISTENED_END(EntityRideEvent)
|
||||||
}
|
// return rtn;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
////////////// EntityStepOnPressurePlate //////////////
|
////////////// EntityStepOnPressurePlate //////////////
|
||||||
TClasslessInstanceHook(bool, "?shouldTriggerEntityInside@BasePressurePlateBlock@@UEBA_NAEAVBlockSource@@AEBVBlockPos@@AEAVActor@@@Z",
|
// 没有这个符号
|
||||||
BlockSource* a2, BlockPos* a3, Actor* a4) {
|
// TClasslessInstanceHook(bool, "?shouldTriggerEntityInside@BasePressurePlateBlock@@UEBA_NAEAVBlockSource@@AEBVBlockPos@@AEAVActor@@@Z",
|
||||||
IF_LISTENED(EntityStepOnPressurePlateEvent) {
|
// BlockSource* a2, BlockPos* a3, Actor* a4) {
|
||||||
EntityStepOnPressurePlateEvent ev{};
|
// IF_LISTENED(EntityStepOnPressurePlateEvent) {
|
||||||
ev.mActor = a4;
|
// EntityStepOnPressurePlateEvent ev{};
|
||||||
ev.mBlockInstance = Level::getBlockInstance(a3, a4->getDimensionId());
|
// ev.mActor = a4;
|
||||||
if (!ev.call())
|
// ev.mBlockInstance = Level::getBlockInstance(a3, a4->getDimensionId());
|
||||||
return false;
|
// if (!ev.call())
|
||||||
}
|
// return false;
|
||||||
IF_LISTENED_END(EntityStepOnPressurePlateEvent)
|
// }
|
||||||
return original(this, a2, a3, a4);
|
// IF_LISTENED_END(EntityStepOnPressurePlateEvent)
|
||||||
}
|
// return original(this, a2, a3, a4);
|
||||||
|
// }
|
||||||
|
|
||||||
////////////// ProjectileSpawn //////////////
|
////////////// ProjectileSpawn //////////////
|
||||||
// TClasslessInstanceHook(Actor*,
|
// TClasslessInstanceHook(Actor*,
|
||||||
@ -1962,25 +1981,26 @@ TClasslessInstanceHook(void, "?onScoreChanged@ServerScoreboard@@UEAAXAEBUScorebo
|
|||||||
|
|
||||||
#include <MC/Minecraft.hpp>
|
#include <MC/Minecraft.hpp>
|
||||||
////////////// ServerStarted //////////////
|
////////////// ServerStarted //////////////
|
||||||
TClasslessInstanceHook(void, "?sendServerThreadStarted@ServerInstanceEventCoordinator@@QEAAXAEAVServerInstance@@@Z",
|
// 没有这个符号
|
||||||
class ServerInstance& ins) {
|
// TClasslessInstanceHook(void, "?sendServerThreadStarted@ServerInstanceEventCoordinator@@QEAAXAEAVServerInstance@@@Z",
|
||||||
if(!LL::isDebugMode())
|
// class ServerInstance& ins) {
|
||||||
_set_se_translator(seh_exception::TranslateSEHtoCE);
|
// if(!LL::isDebugMode())
|
||||||
|
// _set_se_translator(seh_exception::TranslateSEHtoCE);
|
||||||
|
|
||||||
LL::globalConfig.tickThreadId = std::this_thread::get_id();
|
// LL::globalConfig.tickThreadId = std::this_thread::get_id();
|
||||||
Global<Level> = Global<Minecraft>->getLevel();
|
// Global<Level> = Global<Minecraft>->getLevel();
|
||||||
Global<ServerLevel> = (ServerLevel*)Global<Minecraft>->getLevel();
|
// Global<ServerLevel> = (ServerLevel*)Global<Minecraft>->getLevel();
|
||||||
// Global<ServerNetworkHandler> = Global<Minecraft>->getServerNetworkHandler();
|
// // Global<ServerNetworkHandler> = Global<Minecraft>->getServerNetworkHandler();
|
||||||
LL::globalConfig.serverStatus = LL::LLServerStatus::Running;
|
// LL::globalConfig.serverStatus = LL::LLServerStatus::Running;
|
||||||
|
|
||||||
IF_LISTENED(ServerStartedEvent) {
|
// IF_LISTENED(ServerStartedEvent) {
|
||||||
ServerStartedEvent ev{};
|
// ServerStartedEvent ev{};
|
||||||
ev.call();
|
// ev.call();
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(ServerStartedEvent)
|
// IF_LISTENED_END(ServerStartedEvent)
|
||||||
|
|
||||||
original(this, ins);
|
// original(this, ins);
|
||||||
}
|
// }
|
||||||
|
|
||||||
////////////// ServerStopped //////////////
|
////////////// ServerStopped //////////////
|
||||||
TClasslessInstanceHook(void, "??1DedicatedServer@@UEAA@XZ") {
|
TClasslessInstanceHook(void, "??1DedicatedServer@@UEAA@XZ") {
|
||||||
@ -2058,27 +2078,28 @@ TInstanceHook(void*, "?handle@ComplexInventoryTransaction@@UEBA?AW4InventoryTran
|
|||||||
return original(this, a2, a3);
|
return original(this, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
TInstanceHook(void, "?dropSlot@Inventory@@QEAAXH_N00@Z",
|
// 没有这个符号
|
||||||
Container, int a2, char a3, char a4, bool a5) {
|
// TInstanceHook(void, "?dropSlot@Inventory@@QEAAXH_N00@Z",
|
||||||
auto pl = dAccess<Player*, 248>(this);
|
// Container, int a2, char a3, char a4, bool a5) {
|
||||||
if (pl->isPlayer()) {
|
// auto pl = dAccess<Player*, 248>(this);
|
||||||
IF_LISTENED(PlayerDropItemEvent) {
|
// if (pl->isPlayer()) {
|
||||||
PlayerDropItemEvent ev{};
|
// IF_LISTENED(PlayerDropItemEvent) {
|
||||||
if (a2 >= 0) {
|
// PlayerDropItemEvent ev{};
|
||||||
auto& item = this->getItem(a2);
|
// if (a2 >= 0) {
|
||||||
if (!item.isNull()) {
|
// auto& item = this->getItem(a2);
|
||||||
ev.mItemStack = const_cast<ItemStack*>(&item);
|
// if (!item.isNull()) {
|
||||||
ev.mPlayer = pl;
|
// ev.mItemStack = const_cast<ItemStack*>(&item);
|
||||||
}
|
// ev.mPlayer = pl;
|
||||||
if (!ev.call()) {
|
// }
|
||||||
return;
|
// if (!ev.call()) {
|
||||||
}
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
IF_LISTENED_END(PlayerDropItemEvent)
|
// }
|
||||||
}
|
// IF_LISTENED_END(PlayerDropItemEvent)
|
||||||
return original(this, a2, a3, a4, a5);
|
// }
|
||||||
}
|
// return original(this, a2, a3, a4, a5);
|
||||||
|
// }
|
||||||
|
|
||||||
////////////// PlayerBedEnter //////////////
|
////////////// PlayerBedEnter //////////////
|
||||||
TInstanceHook(int, "?startSleepInBed@Player@@UEAA?AW4BedSleepingResult@@AEBVBlockPos@@@Z",
|
TInstanceHook(int, "?startSleepInBed@Player@@UEAA?AW4BedSleepingResult@@AEBVBlockPos@@@Z",
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
Actor* Level::getEntity(ActorUniqueID uniqueId) {
|
Actor* Level::getEntity(ActorUniqueID uniqueId) {
|
||||||
try {
|
try {
|
||||||
|
// 完蛋,没有这个符号
|
||||||
return SymCall("?fetchEntity@Level@@UEBAPEAVActor@@UActorUniqueID@@_N@Z", Actor*, Level*, ActorUniqueID)(Global<Level>, uniqueId);
|
return SymCall("?fetchEntity@Level@@UEBAPEAVActor@@UActorUniqueID@@_N@Z", Actor*, Level*, ActorUniqueID)(Global<Level>, uniqueId);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -223,6 +224,7 @@ std::vector<Actor*> Level::getAllEntities(int dimId) {
|
|||||||
|
|
||||||
// Check Valid
|
// Check Valid
|
||||||
std::vector<Actor*> result;
|
std::vector<Actor*> result;
|
||||||
|
// 阿这,这个符号也没有
|
||||||
auto currTick = SymCall("?getCurrentTick@Level@@UEBAAEBUTick@@XZ", Tick*, Level*)(lv)->t;
|
auto currTick = SymCall("?getCurrentTick@Level@@UEBAAEBUTick@@XZ", Tick*, Level*)(lv)->t;
|
||||||
for (auto& i : list) {
|
for (auto& i : list) {
|
||||||
// auto entity = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ",
|
// auto entity = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ",
|
||||||
@ -289,6 +291,7 @@ Player* Level::getPlayer(const string& info) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player* Level::getPlayer(ActorUniqueID id) {
|
Player* Level::getPlayer(ActorUniqueID id) {
|
||||||
|
// 裂开,这个符号也没有
|
||||||
return SymCall("?getPlayer@Level@@UEBAPEAVPlayer@@UActorUniqueID@@@Z", Player*, Level*, ActorUniqueID)(Global<Level>, id);
|
return SymCall("?getPlayer@Level@@UEBAPEAVPlayer@@UActorUniqueID@@@Z", Player*, Level*, ActorUniqueID)(Global<Level>, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,15 +42,17 @@ TInstanceHook(void, "?allowIncomingConnections@ServerNetworkHandler@@QEAAXAEBV?$
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// MinecraftCommands
|
// MinecraftCommands
|
||||||
TInstanceHook(void,
|
// 没有这个符号
|
||||||
"?initCoreEnums@MinecraftCommands@@QEAAXVItemRegistryRef@@AEBVIWorldRegistriesProvider@@AEBVActorFactory@"
|
// TInstanceHook(void,
|
||||||
"@AEBVExperiments@@AEBVBaseGameVersion@@@Z",
|
// "?initCoreEnums@MinecraftCommands@@QEAAXVItemRegistryRef@@AEBVIWorldRegistriesProvider@@AEBVActorFactory@"
|
||||||
MinecraftCommands, void* a2, __int64 a3, __int64 a4, void* a5, void* a6) {
|
// "@AEBVExperiments@@AEBVBaseGameVersion@@@Z",
|
||||||
original(this, a2, a3, a4, a5, a6);
|
// MinecraftCommands, void* a2, __int64 a3, __int64 a4, void* a5, void* a6) {
|
||||||
Global<MinecraftCommands> = this;
|
// original(this, a2, a3, a4, a5, a6);
|
||||||
}
|
// Global<MinecraftCommands> = this;
|
||||||
|
// }
|
||||||
|
|
||||||
// LevelStorage & DBStorage
|
// LevelStorage & DBStorage
|
||||||
|
// 没有这个符号,去掉应该会狗带吧?
|
||||||
TInstanceHook(DBStorage*, "??0DBStorage@@QEAA@UDBStorageConfig@@V?$not_null@V?$NonOwnerPointer@VLevelDbEnv@@@Bedrock@@@gsl@@@Z",
|
TInstanceHook(DBStorage*, "??0DBStorage@@QEAA@UDBStorageConfig@@V?$not_null@V?$NonOwnerPointer@VLevelDbEnv@@@Bedrock@@@gsl@@@Z",
|
||||||
DBStorage, struct DBStorageConfig* config, void* a3) {
|
DBStorage, struct DBStorageConfig* config, void* a3) {
|
||||||
auto ret = original(this, config, a3);
|
auto ret = original(this, config, a3);
|
||||||
@ -70,8 +72,9 @@ THook(void*, "??0ChunkSource@@QEAA@V?$unique_ptr@VChunkSource@@U?$default_delete
|
|||||||
|
|
||||||
// RakNetServerLocator
|
// RakNetServerLocator
|
||||||
// ?activate@RakNetServerLocator@@AEAAXXZ
|
// ?activate@RakNetServerLocator@@AEAAXXZ
|
||||||
|
// 没有这个符号,两个都是一样的
|
||||||
TInstanceHook(void*, "?_activate@RakNetServerLocator@@AEAAXXZ", RakNetServerLocator) {
|
TInstanceHook(void*, "?_activate@RakNetServerLocator@@AEAAXXZ", RakNetServerLocator) {
|
||||||
constexpr auto h = do_hash("?_activate@RakNetServerLocator@@AEAAXXZ");
|
//constexpr auto h = do_hash("?_activate@RakNetServerLocator@@AEAAXXZ");
|
||||||
static bool set = false;
|
static bool set = false;
|
||||||
if (!set) {
|
if (!set) {
|
||||||
set = true;
|
set = true;
|
||||||
|
@ -125,23 +125,24 @@ void CheckRunningBDS() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FixAllowList() {
|
void FixAllowList() {
|
||||||
if (filesystem::exists("whitelist.json")) {
|
// 这个应该不必改吧?以后也许会同步
|
||||||
if (filesystem::exists("allowlist.json")) {
|
// if (filesystem::exists("whitelist.json")) {
|
||||||
auto res = ReadAllFile("allowlist.json");
|
// if (filesystem::exists("allowlist.json")) {
|
||||||
if (res && (res->empty() || nlohmann::json::parse(*res, nullptr, true, true).empty())) {
|
// auto res = ReadAllFile("allowlist.json");
|
||||||
logger.warn(tr("ll.main.fixAllowList.removeEmptyAllowlist"));
|
// if (res && (res->empty() || nlohmann::json::parse(*res, nullptr, true, true).empty())) {
|
||||||
filesystem::remove("allowlist.json");
|
// logger.warn(tr("ll.main.fixAllowList.removeEmptyAllowlist"));
|
||||||
} else {
|
// filesystem::remove("allowlist.json");
|
||||||
logger.warn(tr("ll.main.fixAllowList.checkManually"));
|
// } else {
|
||||||
return;
|
// logger.warn(tr("ll.main.fixAllowList.checkManually"));
|
||||||
}
|
// return;
|
||||||
}
|
// }
|
||||||
std::error_code ec;
|
// }
|
||||||
// Rename whitelist.json to allowlist.json
|
// std::error_code ec;
|
||||||
filesystem::copy_file("whitelist.json", "allowlist.json", filesystem::copy_options::overwrite_existing, ec);
|
// // Rename whitelist.json to allowlist.json
|
||||||
filesystem::remove("whitelist.json", ec);
|
// filesystem::copy_file("whitelist.json", "allowlist.json", filesystem::copy_options::overwrite_existing, ec);
|
||||||
logger.warn(tr("ll.main.fixAllowList.renamed"));
|
// filesystem::remove("whitelist.json", ec);
|
||||||
}
|
// logger.warn(tr("ll.main.fixAllowList.renamed"));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void RegisterCommands();
|
extern void RegisterCommands();
|
||||||
|
@ -49,10 +49,11 @@ THook(void, "?PlatformBedrockLogOut@@YAXIPEBD@Z", int a1, const char* ts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Block BDS from adding LOG metadata
|
// Block BDS from adding LOG metadata
|
||||||
THook(void, "?_appendLogEntryMetadata@LogDetails@BedrockLog@@AEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V34@W4LogAreaID@@I1HH@Z",
|
// 没有这个符号,去掉这个应该也没有影响
|
||||||
void* a1, void* a2, void** a3, int a4, unsigned int a5, __int64 a6, unsigned int a7, unsigned int a8) {
|
// THook(void, "?_appendLogEntryMetadata@LogDetails@BedrockLog@@AEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V34@W4LogAreaID@@I1HH@Z",
|
||||||
return;
|
// void* a1, void* a2, void** a3, int a4, unsigned int a5, __int64 a6, unsigned int a7, unsigned int a8) {
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
#include "LiteLoader.h"
|
#include "LiteLoader.h"
|
||||||
#include <MC/BedrockLog.hpp>
|
#include <MC/BedrockLog.hpp>
|
||||||
|
Loading…
Reference in New Issue
Block a user