RemotePlayer.java
net.minecraft.client.player.RemotePlayer
信息
- 全限定名:net.minecraft.client.player.RemotePlayer
- 类型:public class
- 包:net.minecraft.client.player
- 源码路径:src/main/java/net/minecraft/client/player/RemotePlayer.java
- 起始行号:L14
- 继承:AbstractClientPlayer
- 职责:
TODO
字段/常量
-
lerpDeltaMovement- 类型:
Vec3 - 修饰符:
private - 源码定位:
L15 - 说明:
TODO
- 类型:
-
lerpDeltaMovementSteps- 类型:
int - 修饰符:
private - 源码定位:
L16 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public RemotePlayer(ClientLevel level, GameProfile gameProfile) @ L18
- 构造器名:RemotePlayer
- 源码定位:L18
- 修饰符:public
参数:
- level: ClientLevel
- gameProfile: GameProfile
说明:
TODO
方法
下面的方法块按源码顺序生成。
public boolean shouldRenderAtSqrDistance(double distance) @ L23
- 方法名:shouldRenderAtSqrDistance
- 源码定位:L23
- 返回类型:boolean
- 修饰符:public
参数:
- distance: double
说明:
TODO
public boolean hurtClient(DamageSource source) @ L34
- 方法名:hurtClient
- 源码定位:L34
- 返回类型:boolean
- 修饰符:public
参数:
- source: DamageSource
说明:
TODO
public void tick() @ L39
- 方法名:tick
- 源码定位:L39
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public void aiStep() @ L45
- 方法名:aiStep
- 源码定位:L45
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public void lerpMotion(Vec3 movement) @ L75
- 方法名:lerpMotion
- 源码定位:L75
- 返回类型:void
- 修饰符:public
参数:
- movement: Vec3
说明:
TODO
protected void updatePlayerPose() @ L81
- 方法名:updatePlayerPose
- 源码定位:L81
- 返回类型:void
- 修饰符:protected
参数:
- 无
说明:
TODO
public void recreateFromPacket(ClientboundAddEntityPacket packet) @ L85
- 方法名:recreateFromPacket
- 源码定位:L85
- 返回类型:void
- 修饰符:public
参数:
- packet: ClientboundAddEntityPacket
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class RemotePlayer extends AbstractClientPlayer {
private Vec3 lerpDeltaMovement = Vec3.ZERO;
private int lerpDeltaMovementSteps;
public RemotePlayer(ClientLevel level, GameProfile gameProfile) {
super(level, gameProfile);
this.noPhysics = true;
}
@Override
public boolean shouldRenderAtSqrDistance(double distance) {
double size = this.getBoundingBox().getSize() * 10.0;
if (Double.isNaN(size)) {
size = 1.0;
}
size *= 64.0 * getViewScale();
return distance < size * size;
}
@Override
public boolean hurtClient(DamageSource source) {
return true;
}
@Override
public void tick() {
super.tick();
this.calculateEntityAnimation(false);
}
@Override
public void aiStep() {
if (this.isInterpolating()) {
this.getInterpolation().interpolate();
}
if (this.lerpHeadSteps > 0) {
this.lerpHeadRotationStep(this.lerpHeadSteps, this.lerpYHeadRot);
this.lerpHeadSteps--;
}
if (this.lerpDeltaMovementSteps > 0) {
this.addDeltaMovement(
new Vec3(
(this.lerpDeltaMovement.x - this.getDeltaMovement().x) / this.lerpDeltaMovementSteps,
(this.lerpDeltaMovement.y - this.getDeltaMovement().y) / this.lerpDeltaMovementSteps,
(this.lerpDeltaMovement.z - this.getDeltaMovement().z) / this.lerpDeltaMovementSteps
)
);
this.lerpDeltaMovementSteps--;
}
this.updateSwingTime();
this.updateBob();
try (Zone ignored = Profiler.get().zone("push")) {
this.pushEntities();
}
}
@Override
public void lerpMotion(Vec3 movement) {
this.lerpDeltaMovement = movement;
this.lerpDeltaMovementSteps = this.getType().updateInterval() + 1;
}
@Override
protected void updatePlayerPose() {
}
@Override
public void recreateFromPacket(ClientboundAddEntityPacket packet) {
super.recreateFromPacket(packet);
this.setOldPosAndRot();
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Profiler.get()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/字段/构造调用 - 关联成员:
Vec3()
- 引用位置: