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
adbb5bd375
commit
7a597c698e
@ -56,7 +56,8 @@ bool Actor::isPlayer(bool allowSimulatedPlayer) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Actor::isOnGround() 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 {
|
std::string Actor::getTypeName() const {
|
||||||
@ -76,9 +77,9 @@ bool Actor::isOnGround() const {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[deprecated]]
|
||||||
Vec2* Actor::getDirection() const {
|
Vec2* Actor::getDirection() const {
|
||||||
return (Vec2*)(this + 312); // IDA: Actor::getRotation()
|
return (Vec2*)(this + 256); // 猜的 mRos
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockPos Actor::getBlockPos() {
|
BlockPos Actor::getBlockPos() {
|
||||||
@ -120,7 +121,8 @@ ActorUniqueID Actor::getActorUniqueId() const {
|
|||||||
|
|
||||||
SimpleContainer & Actor::getHandContainer(){
|
SimpleContainer & Actor::getHandContainer(){
|
||||||
//ScriptHandContainerComponent::hasComponent actor
|
//ScriptHandContainerComponent::hasComponent actor
|
||||||
return dAccess<SimpleContainer>(this, 176);
|
// return dAccess<SimpleContainer>(this, 176);
|
||||||
|
return *this->mHand;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack* Actor::getHandSlot() {
|
ItemStack* Actor::getHandSlot() {
|
||||||
@ -131,7 +133,7 @@ ItemStack* Actor::getHandSlot() {
|
|||||||
|
|
||||||
SimpleContainer & Actor::getArmorContainer(){
|
SimpleContainer & Actor::getArmorContainer(){
|
||||||
// ItemStackNetManagerServer::_handleLegacyTransactionRequest Line46
|
// ItemStackNetManagerServer::_handleLegacyTransactionRequest Line46
|
||||||
return dAccess<SimpleContainer>(this, 1400);
|
return *this->mArmor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Actor::rename(const string& name) {
|
bool Actor::rename(const string& name) {
|
||||||
|
@ -35,9 +35,9 @@ Block* BlockInstance::getBlock() {
|
|||||||
return isNull() ? nullptr : block;
|
return isNull() ? nullptr : block;
|
||||||
};
|
};
|
||||||
|
|
||||||
// bool BlockInstance::hasBlockEntity() {
|
bool BlockInstance::hasBlockEntity() {
|
||||||
// return block->hasBlockEntity();
|
return block->hasBlockEntity();
|
||||||
// }
|
}
|
||||||
|
|
||||||
BlockActor* BlockInstance::getBlockEntity() {
|
BlockActor* BlockInstance::getBlockEntity() {
|
||||||
return Level::getBlockSource(dim)->getBlockEntity(pos);
|
return Level::getBlockSource(dim)->getBlockEntity(pos);
|
||||||
|
@ -569,8 +569,8 @@ Local<Value> EntityClass::getDirection() {
|
|||||||
if (!entity)
|
if (!entity)
|
||||||
return Local<Value>();
|
return Local<Value>();
|
||||||
|
|
||||||
Vec2* vec = entity->getDirection();
|
Vec2 vec = entity->getRotation();
|
||||||
return DirectionAngle::newAngle(vec->x, vec->y);
|
return DirectionAngle::newAngle(vec.x, vec.y);
|
||||||
}
|
}
|
||||||
CATCH("Fail in getDirection!")
|
CATCH("Fail in getDirection!")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user