mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-03 04:23:39 +00:00
适配不是个啥
This commit is contained in:
parent
dce1c7c356
commit
0718b084a0
@ -26,7 +26,7 @@ public:
|
||||
Dimension* mDimension = dAccess< Dimension*>(this, 4);
|
||||
return dAccess<AutomaticID<class Dimension, int>>(mDimension, 192);
|
||||
};
|
||||
LevelChunk * getChunkAt(BlockPos& pos) const{
|
||||
LevelChunk * getChunkAt(const BlockPos& pos) const{
|
||||
ChunkPos chunkPos = ChunkPos(pos.x>>4, pos.z>>4);
|
||||
return getChunk(chunkPos);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@ ChunkBlockPos(char x, short y, char z)
|
||||
: x(x)
|
||||
, y(y)
|
||||
, z(z){};
|
||||
|
||||
ChunkBlockPos(class BlockPos const & pos, short a2){
|
||||
ChunkBlockPos(pos.x & 16,pos.y - a2,pos.z & 16);
|
||||
};
|
||||
ChunkBlockPos(unsigned char x, class ChunkLocalHeight y, unsigned char z){
|
||||
ChunkBlockPos(x, y, z);
|
||||
}
|
||||
#undef AFTER_EXTRA
|
||||
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_CHUNKBLOCKPOS
|
||||
public:
|
||||
@ -57,26 +62,26 @@ public:
|
||||
* @symbol ??0ChunkBlockPos@@QEAA@EVChunkLocalHeight@@E@Z
|
||||
* @hash -1288855647
|
||||
*/
|
||||
MCAPI ChunkBlockPos(unsigned char, class ChunkLocalHeight, unsigned char);
|
||||
//MCAPI ChunkBlockPos(unsigned char, class ChunkLocalHeight, unsigned char);
|
||||
/**
|
||||
* @symbol ??0ChunkBlockPos@@QEAA@AEBVBlockPos@@F@Z
|
||||
* @hash -1853558367
|
||||
*/
|
||||
MCAPI ChunkBlockPos(class BlockPos const &, short);
|
||||
//MCAPI ChunkBlockPos(class BlockPos const &, short);
|
||||
/**
|
||||
* @symbol ?toPos@ChunkBlockPos@@QEBA?AVPos@@XZ
|
||||
* @hash 1137411744
|
||||
*/
|
||||
MCAPI class Pos toPos() const;
|
||||
//MCAPI class Pos toPos() const;
|
||||
/**
|
||||
* @symbol ?from2D@ChunkBlockPos@@SA?AV1@EE@Z
|
||||
* @hash 2007391019
|
||||
*/
|
||||
MCAPI static class ChunkBlockPos from2D(unsigned char, unsigned char);
|
||||
//MCAPI static class ChunkBlockPos from2D(unsigned char, unsigned char);
|
||||
/**
|
||||
* @symbol ?fromLegacyIndex@ChunkBlockPos@@SA?AV1@G@Z
|
||||
* @hash -1358394925
|
||||
*/
|
||||
MCAPI static class ChunkBlockPos fromLegacyIndex(unsigned short);
|
||||
//MCAPI static class ChunkBlockPos fromLegacyIndex(unsigned short);
|
||||
|
||||
};
|
@ -12,12 +12,11 @@ namespace CommandUtils {
|
||||
|
||||
#define AFTER_EXTRA
|
||||
|
||||
// std::string getActorName(Actor &actor,int a1) {
|
||||
// //a1是没啥用的,只是为了改变符号
|
||||
// std::string (*rv)(Actor &);
|
||||
// *((void**)&rv) = dlsym("?getEntityName@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVActor@@@Z");
|
||||
// return (*rv)(actor);
|
||||
// }
|
||||
inline std::string getActorName(class Actor const &actor) {
|
||||
std::string (*rv)(class Actor const &);
|
||||
*((void**)&rv) = dlsym("?getEntityName@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVActor@@@Z");
|
||||
return (*rv)(actor);
|
||||
}
|
||||
#undef AFTER_EXTRA
|
||||
MCAPI extern std::vector<struct std::pair<std::string, char>> const CMD_INPUT_UNICODE_TRANSLATE_MAP;
|
||||
MCAPI bool addItemInstanceComponents(class ItemInstance &, class Json::Value const &, std::string &);
|
||||
|
@ -12,8 +12,12 @@ class Dimension {
|
||||
#define AFTER_EXTRA
|
||||
public:
|
||||
BlockSource& getBlockSourceFromMainChunkSource() const{
|
||||
return *dAccess<BlockSource*>(this, 96);
|
||||
//ExplorationMapFunction::apply Line57
|
||||
return *dAccess<BlockSource*>(this, 72);
|
||||
};
|
||||
int getHeight(){
|
||||
return dAccess<int>(this,202);
|
||||
}
|
||||
#undef AFTER_EXTRA
|
||||
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_DIMENSION
|
||||
public:
|
||||
|
@ -332,8 +332,7 @@
|
||||
for (auto& actor : actors) {
|
||||
if (!first)
|
||||
oss << ", ";
|
||||
oss << actor->getNameTag();
|
||||
//oss << CommandUtils::getActorName(*actor,1);
|
||||
oss << CommandUtils::getActorName(*actor);
|
||||
}
|
||||
oss << "]";
|
||||
return fmt::format("name: {:15s}, type: {:15s}, isSet: {:5}, value: {}", name, typeName, isSet, oss.str());
|
||||
|
@ -323,6 +323,7 @@ TClasslessInstanceHook(void, "?sendLoginMessageLocal@ServerNetworkHandler@@QEAAX
|
||||
/////////////////// PlayerJoin ///////////////////
|
||||
TInstanceHook(bool, "?onReady_ClientGeneration@ServerNetworkHandler@@QEAAXAEAVPlayer@@AEBVNetworkIdentifier@@@Z",
|
||||
ServerNetworkHandler,Player* player,NetworkIdentifier *net) {
|
||||
//std::cout<<"PlayerJoin"<<std::endl;
|
||||
IF_LISTENED(PlayerJoinEvent) {
|
||||
PlayerJoinEvent ev{};
|
||||
ev.mPlayer = player;
|
||||
@ -336,8 +337,9 @@ TClasslessInstanceHook(void, "?sendLoginMessageLocal@ServerNetworkHandler@@QEAAX
|
||||
|
||||
|
||||
/////////////////// PlayerLeft ///////////////////
|
||||
THook(void, "?_onPlayerLeft@ServerNetworkHandler@@AEAAXPEAVServerPlayer@@_N@Z",
|
||||
ServerNetworkHandler *_this,ServerPlayer* sp,char a3) {
|
||||
TInstanceHook(void, "?_onPlayerLeft@ServerNetworkHandler@@AEAAXPEAVServerPlayer@@_N@Z",
|
||||
ServerNetworkHandler,ServerPlayer* sp,char a3) {
|
||||
//std::cout<<"PlayerJoin"<<std::endl;
|
||||
IF_LISTENED(PlayerLeftEvent) {
|
||||
PlayerLeftEvent ev{};
|
||||
ev.mPlayer = sp;
|
||||
@ -345,7 +347,7 @@ TClasslessInstanceHook(void, "?sendLoginMessageLocal@ServerNetworkHandler@@QEAAX
|
||||
ev.call();
|
||||
}
|
||||
IF_LISTENED_END(PlayerLeftEvent)
|
||||
return original(_this,sp,a3);
|
||||
return original(this,sp,a3);
|
||||
}
|
||||
|
||||
/////////////////// PlayerRespawn ///////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user