Skip to content

Commit

Permalink
1.16.201 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhxiao committed Jan 14, 2021
1 parent 5a780c8 commit c6123de
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 392 deletions.
16 changes: 10 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 22 additions & 21 deletions api/block/BlockSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ namespace trapdoor {
using namespace SymHook;

Block *BlockSource::getBlock(int x, int y, int z) {
return SYM_CALL(
Block* (*)(void * , int, int, int),
MSSYM_B1QA8getBlockB1AE11BlockSourceB2AAE13QEBAAEBVBlockB2AAA3HHHB1AA1Z, this,
x, y, z
);
return getBlock({x, y, z});
}


Block *BlockSource::getBlock(const BlockPos &blockPos) {
return getBlock(blockPos.x, blockPos.y, blockPos.z);
return SYM_CALL(
Block* (*)(void * ,const BlockPos &),
MSSYM_B1QA8getBlockB1AE11BlockSourceB2AAE13QEBAAEBVBlockB2AAE12AEBVBlockPosB3AAAA1Z, this,
blockPos
);
// return getBlock(blockPos.x, blockPos.y, blockPos.z);
}

void BlockSource::setBlock(BlockPos *blockPos, Block *block) {
Expand Down Expand Up @@ -60,21 +61,21 @@ namespace trapdoor {
);
}

uint8_t BlockSource::getRawBrightness(const BlockPos *pos) {
uint8_t result = 255;
auto r = SYM_CALL(
uint8_t *(*)(BlockSource * , uint8_t *,const BlockPos *, bool, bool),
MSSYM_B1QE16getRawBrightnessB1AE11BlockSourceB2AAA4QEBAB1QE12AUBrightnessB2AAE12AEBVBlockPosB3AAUA2N1B1AA1Z,
this,
&result,
pos,
true,
true
);
printf("%d %d\n", result, *r);
return result;

}
// uint8_t BlockSource::getRawBrightness(const BlockPos *pos) {
// uint8_t result = 255;
// auto r = SYM_CALL(
// uint8_t *(*)(BlockSource * , uint8_t *,const BlockPos *, bool, bool),
// MSSYM_B1QE16getRawBrightnessB1AE11BlockSourceB2AAA4QEBAB1QE12AUBrightnessB2AAE12AEBVBlockPosB3AAUA2N1B1AA1Z,
// this,
// &result,
// pos,
// true,
// true
// );
// printf("%d %d\n", result, *r);
// return result;
//
// }

int BlockSource::getMaterial(const BlockPos *pos) {
return
Expand Down
8 changes: 3 additions & 5 deletions api/entity/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace trapdoor {

BlockSource *Actor::getBlockSource() {
//!from Player::tickWorld
return *((struct BlockSource **) this + 100);
return *((struct BlockSource **) this + 105);
}

void Actor::setGameMode(int mode) {
Expand All @@ -68,8 +68,6 @@ namespace trapdoor {
}




int Actor::getDimensionID() {

return *(reinterpret_cast<int *>(this) + 51);
Expand All @@ -89,8 +87,8 @@ namespace trapdoor {
}

NetworkIdentifier *Actor::getClientID() {
// ServerPlayer::isHostingPlayer
return reinterpret_cast<NetworkIdentifier *>((char *) this + 2432);
// !from ServerPlayer::isHostingPlayer
return reinterpret_cast<NetworkIdentifier *>((char *) this + 2536);
}

PlayerPermissionLevel Actor::getCommandLevel() {
Expand Down
Loading

0 comments on commit c6123de

Please sign in to comment.