net.minecraft.entity.Entity.setEntityBoundingBox()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中net.minecraft.entity.Entity.setEntityBoundingBox()方法的一些代码示例,展示了Entity.setEntityBoundingBox()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.setEntityBoundingBox()方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:setEntityBoundingBox

Entity.setEntityBoundingBox介绍

暂无

代码示例

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

thisClassAsAnEntity.setEntityBoundingBox(thisClassAsAnEntity.getEntityBoundingBox().offset(0.0D, y, 0.0D));
      .setEntityBoundingBox(thisClassAsAnEntity.getEntityBoundingBox().offset(x, 0.0D, 0.0D));
      .setEntityBoundingBox(thisClassAsAnEntity.getEntityBoundingBox().offset(0.0D, 0.0D, z));
double d7 = z;
AxisAlignedBB axisalignedbb1 = thisClassAsAnEntity.getEntityBoundingBox();
thisClassAsAnEntity.setEntityBoundingBox(axisalignedbb);
y = thisClassAsAnEntity.stepHeight;
List<AxisAlignedBB> list = thisClassAsAnEntity.world.getCollisionBoxes(thisClassAsAnEntity,
  z = d19;
  y = -d8;
  thisClassAsAnEntity.setEntityBoundingBox(axisalignedbb2);
} else {
  x = d21;
  z = d22;
  y = -d20;
  thisClassAsAnEntity.setEntityBoundingBox(axisalignedbb4);
thisClassAsAnEntity.setEntityBoundingBox(thisClassAsAnEntity.getEntityBoundingBox().offset(0.0D, y, 0.0D));
  y = d6;
  z = d7;
  thisClassAsAnEntity.setEntityBoundingBox(axisalignedbb1);

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

entity.setEntityBoundingBox(originalBoundingBox);
entity.setEntityBoundingBox(entity.getEntityBoundingBox().offset(draggable.getVelocityAddedToPlayer().X,
    draggable.getVelocityAddedToPlayer().Y, draggable.getVelocityAddedToPlayer().Z));
entity.resetPositionToBB();

代码示例来源:origin: TeamWizardry/Wizardry

entity.setEntityBoundingBox(entity.getEntityBoundingBox().offset(0.0D, y, 0.0D));
if (x != 0.0D) entity.setEntityBoundingBox(entity.getEntityBoundingBox().offset(x, 0.0D, 0.0D));
if (z != 0.0D) entity.setEntityBoundingBox(entity.getEntityBoundingBox().offset(0.0D, 0.0D, z));
  double d7 = z;
  AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox();
  entity.setEntityBoundingBox(axisalignedbb);
  y = (double) entity.stepHeight;
  List<AxisAlignedBB> list = entity.world.getCollisionBoxes(entity, entity.getEntityBoundingBox().offset(d2, y, d4));
    z = d4;
    y = -d8;
    entity.setEntityBoundingBox(axisalignedbb2);
  } else {
    x = d2;
    z = d4;
    y = -d20;
    entity.setEntityBoundingBox(axisalignedbb4);
  entity.setEntityBoundingBox(entity.getEntityBoundingBox().offset(0.0D, y, 0.0D));
    y = d6;
    z = d7;
    entity.setEntityBoundingBox(axisalignedbb1);

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

@Override
public void updatePassenger(Entity passenger) {
  Vector inLocal = wrapping.getLocalPositionForEntity(passenger);
  if (inLocal != null) {
    Vector newEntityPosition = new Vector(inLocal);
    float f = passenger.width / 2.0F;
    float f1 = passenger.height;
    AxisAlignedBB inLocalAABB = new AxisAlignedBB(newEntityPosition.X - f, newEntityPosition.Y,
        newEntityPosition.Z - f, newEntityPosition.X + f, newEntityPosition.Y + f1,
        newEntityPosition.Z + f);
    wrapping.coordTransform.fromLocalToGlobal(newEntityPosition);
    passenger.setPosition(newEntityPosition.X, newEntityPosition.Y, newEntityPosition.Z);
    Polygon entityBBPoly = new Polygon(inLocalAABB, wrapping.coordTransform.lToWTransform);
    AxisAlignedBB newEntityBB = entityBBPoly.getEnclosedAABB();
    passenger.setEntityBoundingBox(newEntityBB);
    if (passenger instanceof EntityMountingWeaponBase) {
      passenger.onUpdate();
      for (Entity e : passenger.riddenByEntities) {
        if (wrapping.isEntityFixed(e)) {
          Vector inLocalAgain = wrapping.getLocalPositionForEntity(e);
          if (inLocalAgain != null) {
            Vector newEntityPositionAgain = new Vector(inLocalAgain);
            wrapping.coordTransform.fromLocalToGlobal(newEntityPositionAgain);
            e.setPosition(newEntityPositionAgain.X, newEntityPositionAgain.Y, newEntityPositionAgain.Z);
          }
        }
      }
    }
  }
}

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

entity.setEntityBoundingBox(axisalignedbb);
        entity.setEntityBoundingBox(axisalignedbb);
        entity.resetPositionToBB();
entity.setEntityBoundingBox(axisalignedbb);
entity.resetPositionToBB();

代码示例来源: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));
  }
}

相关文章

微信公众号

最新文章

更多

Entity类方法