本文整理了Java中net.minecraft.entity.Entity.getYOffset()
方法的一些代码示例,展示了Entity.getYOffset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getYOffset()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:getYOffset
暂无
代码示例来源:origin: Vazkii/Botania
public static Vector3 fromEntityCenter(Entity e) {
return new Vector3(e.posX, e.posY - e.getYOffset() + e.height / 2, e.posZ);
}
代码示例来源:origin: CoFH/ThermalDynamics
public void loadRider(Entity passenger) {
this.rider = passenger;
this.originalWidth = passenger.width;
this.originalHeight = passenger.height;
this.originalYOffset = passenger.getYOffset();
if (rider instanceof EntityPlayer) {
originalEyeHeight = ((EntityPlayer) rider).eyeHeight;
}
}
代码示例来源:origin: CoFH/ThermalDynamics
@Override
public double getYOffset() {
return super.getYOffset();
}
代码示例来源:origin: CoFH/ThermalDynamics
@Override
public double getMountedYOffset() {
Entity riddenByEntity = this.rider;
if (riddenByEntity == null) {
return super.getMountedYOffset();
} else {
return -riddenByEntity.getYOffset();
}
}
代码示例来源:origin: Vazkii/Psi
public static Vector3 fromEntityCenter(Entity e) {
return new Vector3(e.posX, e.posY - e.getYOffset() + e.height / 2, e.posZ);
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void updatePassenger(Entity entity) {
super.updatePassenger(entity);
if (entity instanceof EntityLivingBase) {
double a = Math.toRadians(renderYawOffset);
double offSetX = -Math.sin(a) * 0.75D;
double offSetZ = Math.cos(a) * 0.75D;
entity.setPosition(posX - offSetX, posY + 0.8D + entity.getYOffset(), posZ - offSetZ);
}
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void updatePassenger(Entity entity) {
super.updatePassenger(entity);
if (entity instanceof EntityLivingBase) {
double a = Math.toRadians(renderYawOffset);
double offSetX = -Math.sin(a) * 0.1D;
double offSetZ = Math.cos(a) * 0.1D;
entity.setPosition(posX - offSetX, posY + 1.1D + entity.getYOffset(), posZ - offSetZ);
}
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void updatePassenger(Entity entity) {
super.updatePassenger(entity);
if (entity instanceof EntityLivingBase) {
double a = Math.toRadians(renderYawOffset);
double offSetX = -Math.sin(a) * 0.35D;
double offSetZ = Math.cos(a) * 0.35D;
entity.setPosition(posX - offSetX, posY + 1.3D + entity.getYOffset(), posZ - offSetZ);
}
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void updatePassenger(Entity entity) {
super.updatePassenger(entity);
if (entity instanceof EntityLivingBase) {
double a = Math.toRadians(renderYawOffset);
double offSetX = -Math.sin(a) * 0.75D;
double offSetZ = Math.cos(a) * 0.75D;
if (captured())
entity.setPosition(posX + offSetX, posY + 0.75D + entity.getYOffset(), posZ + offSetZ);
if (entity.isSneaking())
entity.setSneaking(false);
}
}
代码示例来源:origin: WayofTime/BloodMagic
@Override
public void updatePassenger(Entity passenger) {
super.updatePassenger(passenger);
float f = MathHelper.sin(this.renderYawOffset * 0.017453292F);
float f1 = MathHelper.cos(this.renderYawOffset * 0.017453292F);
float f2 = 0.1F;
float f3 = 0.0F;
passenger.setPosition(this.posX + (double) (0.1F * f), this.posY + (double) (this.height * 0.5F) + passenger.getYOffset() + 0.0D, this.posZ - (double) (0.1F * f1));
if (passenger instanceof EntityLivingBase) {
((EntityLivingBase) passenger).renderYawOffset = this.renderYawOffset;
}
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void updatePassenger(Entity passenger) {
double posX = this.posX;
double posY = this.posY + this.getRiderVerticalOffset();
double posZ = this.posZ;
float yaw = this.vehicleType.moveRiderWithTurret() ? localTurretRotation : rotationYaw;
posX += Trig.sinDegrees(yaw) * -this.getRiderForwardOffset();
posX += Trig.sinDegrees(yaw + 90) * this.getRiderHorizontalOffset();
posZ += Trig.cosDegrees(yaw) * -this.getRiderForwardOffset();
posZ += Trig.cosDegrees(yaw + 90) * this.getRiderHorizontalOffset();
if (vehicleType.shouldRiderSit()) {
passenger.height = 1.3f;
}
if (passenger instanceof NpcBase) {
passenger.setPositionAndRotation(posX, posY + passenger.getYOffset(), posZ, 180 - localTurretRotation, passenger.rotationPitch);
passenger.setRenderYawOffset(180 - localTurretRotation);
} else {
passenger.setPosition(posX, posY + passenger.getYOffset(), posZ);
passenger.rotationYaw -= this.moveHelper.getRotationSpeed();
}
if (vehicleType.shouldRiderSit()) {
passenger.setEntityBoundingBox(passenger.getEntityBoundingBox().offset(0, 0.6, 0));
}
}
代码示例来源:origin: McJtyMods/TheOneProbe
GlStateManager.translate(0.0F, (float) entity.getYOffset() + (entity instanceof EntityHanging ? 0.5F : 0.0F), 0.0F);
Minecraft.getMinecraft().getRenderManager().playerViewY = 180F;
try {
内容来源于网络,如有侵权,请联系作者删除!