mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-01 19:53:41 +00:00
替换偏移获取
This commit is contained in:
parent
adbb5bd375
commit
7a597c698e
@ -56,7 +56,8 @@ bool Actor::isPlayer(bool allowSimulatedPlayer) const {
|
||||
}
|
||||
|
||||
bool Actor::isOnGround() const {
|
||||
return (dAccess<bool, 472>(this)); // IDA DirectActorProxyImpl<IMobMovementProxy>::isOnGround
|
||||
// return (dAccess<bool, 416>(this)); //猜的
|
||||
return this->mOnGround;
|
||||
}
|
||||
|
||||
std::string Actor::getTypeName() const {
|
||||
@ -76,9 +77,9 @@ bool Actor::isOnGround() const {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[[deprecated]]
|
||||
Vec2* Actor::getDirection() const {
|
||||
return (Vec2*)(this + 312); // IDA: Actor::getRotation()
|
||||
return (Vec2*)(this + 256); // 猜的 mRos
|
||||
}
|
||||
|
||||
BlockPos Actor::getBlockPos() {
|
||||
@ -120,7 +121,8 @@ ActorUniqueID Actor::getActorUniqueId() const {
|
||||
|
||||
SimpleContainer & Actor::getHandContainer(){
|
||||
//ScriptHandContainerComponent::hasComponent actor
|
||||
return dAccess<SimpleContainer>(this, 176);
|
||||
// return dAccess<SimpleContainer>(this, 176);
|
||||
return *this->mHand;
|
||||
}
|
||||
|
||||
ItemStack* Actor::getHandSlot() {
|
||||
@ -131,7 +133,7 @@ ItemStack* Actor::getHandSlot() {
|
||||
|
||||
SimpleContainer & Actor::getArmorContainer(){
|
||||
// ItemStackNetManagerServer::_handleLegacyTransactionRequest Line46
|
||||
return dAccess<SimpleContainer>(this, 1400);
|
||||
return *this->mArmor;
|
||||
}
|
||||
|
||||
bool Actor::rename(const string& name) {
|
||||
|
@ -35,9 +35,9 @@ Block* BlockInstance::getBlock() {
|
||||
return isNull() ? nullptr : block;
|
||||
};
|
||||
|
||||
// bool BlockInstance::hasBlockEntity() {
|
||||
// return block->hasBlockEntity();
|
||||
// }
|
||||
bool BlockInstance::hasBlockEntity() {
|
||||
return block->hasBlockEntity();
|
||||
}
|
||||
|
||||
BlockActor* BlockInstance::getBlockEntity() {
|
||||
return Level::getBlockSource(dim)->getBlockEntity(pos);
|
||||
|
@ -569,8 +569,8 @@ Local<Value> EntityClass::getDirection() {
|
||||
if (!entity)
|
||||
return Local<Value>();
|
||||
|
||||
Vec2* vec = entity->getDirection();
|
||||
return DirectionAngle::newAngle(vec->x, vec->y);
|
||||
Vec2 vec = entity->getRotation();
|
||||
return DirectionAngle::newAngle(vec.x, vec.y);
|
||||
}
|
||||
CATCH("Fail in getDirection!")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user