Java 类net.minecraft.entity.MoverType 实例源码

项目:pnc-repressurized    文件:TileEntityElevatorBase.java   
private void movePlayerDown() {
    if (!getWorld().isRemote) return;

    AxisAlignedBB aabb = new AxisAlignedBB(getPos().getX(), getPos().getY() + 1, getPos().getZ(), getPos().getX() + 1, getPos().getY() + oldExtension + 1.05F, getPos().getZ() + 1);
    List<Entity> entityList = getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb);
    for (Entity entity : entityList) {
        if (entity instanceof EntityPlayer) {
            //   moveEntityToCenter(entity);
            double posX = entity.posX;
            double posZ = entity.posZ;
            if (posX >= getPos().getX() && posX < getPos().getX() + 1 && posZ >= getPos().getZ() && posZ < getPos().getZ() + 1) {
                entity.motionX *= 0.6;
                entity.motionZ *= 0.6;
                entity.move(MoverType.SELF, 0, extension - oldExtension + 0.001F, 0);
            }
        }
    }
}
项目:ArcaneMagic    文件:EntityItemFancy.java   
@Override
public void move(MoverType type, double x, double y, double z)
{
    if (this.freezeTime <= 0)
    {
        Vec3i oldPos = new Vec3i((int) Math.floor(this.getPosition().getX()),
                (int) Math.floor(this.getPosition().getY()), (int) Math.floor(this.getPosition().getZ()));
        super.move(type, x, y, z);
        Vec3i newPos = new Vec3i((int) Math.floor(this.getPosition().getX()),
                (int) Math.floor(this.getPosition().getY()), (int) Math.floor(this.getPosition().getZ()));
        if (!oldPos.equals(newPos))
        {
            if (world.getBlockState(new BlockPos(oldPos)).getBlock() == ModRegistry.FANCY_LIGHT)
            {
                world.setBlockToAir(new BlockPos(oldPos));
            }

            if (world.getBlockState(new BlockPos(newPos)).getBlock() == Blocks.AIR)
            {
                world.setBlockState(new BlockPos(newPos), ModRegistry.FANCY_LIGHT.getDefaultState());
            }
        }
    } else
    {
    }
}
项目:Zombe-Modpack    文件:EntityPlayerSP.java   
/**
 * Tries to move the entity towards the specified location.
 */
@Override
public void moveEntity(MoverType type, double mx, double my, double mz)
{
    double d0 = this.posX;
    double d1 = this.posZ;

    //-ZMod-Fly---------------------------------------------------------------
    ZHandle.handle("beforePlayerMove", new Vec3d(mx,my,mz));
    Vec3d motion = new Vec3d(this.motionX, this.motionY, this.motionZ);
    //------------------------------------------------------------------------

    super.moveEntity(type, mx, my, mz);
    // This was in ZMod before
    // super.moveEntity(type, this.motionX, this.motionY, this.motionZ);

    this.updateAutoJump((float)(this.posX - d0), (float)(this.posZ - d1));

    //-ZMod-Fly---------------------------------------------------------------
    ZHandle.handle("afterPlayerMove", motion);
    //------------------------------------------------------------------------
}
项目:Backmemed    文件:EntityMinecart.java   
/**
 * Moves a minecart that is not attached to a rail
 */
protected void moveDerailedMinecart()
{
    double d0 = this.getMaximumSpeed();
    this.motionX = MathHelper.clamp(this.motionX, -d0, d0);
    this.motionZ = MathHelper.clamp(this.motionZ, -d0, d0);

    if (this.onGround)
    {
        this.motionX *= 0.5D;
        this.motionY *= 0.5D;
        this.motionZ *= 0.5D;
    }

    this.moveEntity(MoverType.SELF, this.motionX, this.motionY, this.motionZ);

    if (!this.onGround)
    {
        this.motionX *= 0.949999988079071D;
        this.motionY *= 0.949999988079071D;
        this.motionZ *= 0.949999988079071D;
    }
}
项目:Backmemed    文件:EntityGuardian.java   
/**
 * Moves the entity based on the specified heading.
 */
public void moveEntityWithHeading(float strafe, float forward)
{
    if (this.isServerWorld() && this.isInWater())
    {
        this.moveRelative(strafe, forward, 0.1F);
        this.moveEntity(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
        this.motionX *= 0.8999999761581421D;
        this.motionY *= 0.8999999761581421D;
        this.motionZ *= 0.8999999761581421D;

        if (!this.isMoving() && this.getAttackTarget() == null)
        {
            this.motionY -= 0.005D;
        }
    }
    else
    {
        super.moveEntityWithHeading(strafe, forward);
    }
}
项目:Backmemed    文件:TileEntityPiston.java   
private void func_190605_a(Entity p_190605_1_, EnumFacing p_190605_2_, double p_190605_3_)
{
    AxisAlignedBB axisalignedbb = p_190605_1_.getEntityBoundingBox();
    AxisAlignedBB axisalignedbb1 = Block.FULL_BLOCK_AABB.offset(this.pos);

    if (axisalignedbb.intersectsWith(axisalignedbb1))
    {
        EnumFacing enumfacing = p_190605_2_.getOpposite();
        double d0 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
        double d1 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb.func_191500_a(axisalignedbb1)) + 0.01D;

        if (Math.abs(d0 - d1) < 0.01D)
        {
            d0 = Math.min(d0, p_190605_3_) + 0.01D;
            field_190613_i.set(p_190605_2_);
            p_190605_1_.moveEntity(MoverType.PISTON, d0 * (double)enumfacing.getFrontOffsetX(), d0 * (double)enumfacing.getFrontOffsetY(), d0 * (double)enumfacing.getFrontOffsetZ());
            field_190613_i.set((EnumFacing)null);
        }
    }
}
项目:ExPetrum    文件:EntityGravFallingBlock.java   
public void updateMovement()
{
    this.prevPosX = this.posX;
       this.prevPosY = this.posY;
       this.prevPosZ = this.posZ;
       this.motionY -= 0.03999999910593033D;
       this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
       this.motionX *= 0.9800000190734863D;
       this.motionY *= 0.9800000190734863D;
       this.motionZ *= 0.9800000190734863D;

       if (!this.onGround && this.world.isRemote)
       {
        this.motionX *= 0.699999988079071D;
           this.motionZ *= 0.699999988079071D;
           this.motionY *= -0.5D;
       }
}
项目:CrystalMod    文件:TileEntityCasePiston.java   
public void fixEntityWithinPistonBase(Entity entity, EnumFacing side, double p_190605_3_)
{
    AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox();
    BlockPos pos = getPos();
    AxisAlignedBB axisalignedbb1 = Block.FULL_BLOCK_AABB.offset(pos);

    if (axisalignedbb.intersectsWith(axisalignedbb1))
    {
        EnumFacing enumfacing = side.getOpposite();
        double d0 = getMovement(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
        double d1 = getMovement(axisalignedbb1, enumfacing, axisalignedbb.intersect(axisalignedbb1)) + 0.01D;

        if (Math.abs(d0 - d1) < 0.01D)
        {
            d0 = Math.min(d0, p_190605_3_) + 0.1D;
            //MOVING_ENTITY.set(p_190605_2_);
            entity.move(MoverType.PISTON, d0 * enumfacing.getFrontOffsetX(), d0 * enumfacing.getFrontOffsetY(), d0 * enumfacing.getFrontOffsetZ());
            //MOVING_ENTITY.set((EnumFacing)null);
        }
    }
}
项目:ToroChess    文件:BlockChessControl.java   
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
  if (!blockHasAlreadyBeenPlaced(stack)) {
    if (!world.isRemote) {
      generateChessBoard(world, pos, placer, stack);
    }

    if (placer != null) {
      placer.move(MoverType.SELF, 0, 2, 0);
    }
  } else {
    BlockPos a8 = BlockPos.fromLong(stack.getTagCompound().getLong(NBT_A8_KEY));
    UUID gameId = stack.getTagCompound().getUniqueId(NBT_GAME_ID_KEY);
    setGameDataToTileEntity(world, pos, a8, gameId);
  }
}
项目:Kingdom-Keys-Re-Coded    文件:EntityBlastBlox.java   
@Override
public void onUpdate () {
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;
    this.motionY -= 0.03999999910593033D;
    move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9800000190734863D;
    this.motionY *= 0.9800000190734863D;
    this.motionZ *= 0.9800000190734863D;

    if (this.onGround) {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
        this.motionY *= -0.5D;
    }

    if (this.fuse-- <= 0) {
        setDead();

        if (!this.world.isRemote) explode();
    } else
        this.world.spawnParticle(EnumParticleTypes.FLAME, this.posX, this.posY, this.posZ, Utils.randomWithRange(-0.05D, 0.05D), 0.1D, Utils.randomWithRange(-0.05D, 0.005D));
}
项目:multishot    文件:Motion.java   
private void moveEntityLinear(Entity entity)
{
    if (entity == null)
    {
        Multishot.logger.fatal("movePlayerLinear(): player was null");
        return;
    }

    double mx, my, mz;
    float yaw, pitch;
    mx = Configs.getMotionX();
    mz = Configs.getMotionZ();
    my = Configs.getMotionY();
    yaw = Configs.getRotationYaw();
    pitch = Configs.getRotationPitch();
    //player.setPositionAndUpdate(pos.xCoord + x, pos.yCoord + y, pos.zCoord + z); // Does strange things...
    //player.setVelocity(mx, my, mz); // Doesn't work for values < 0.005
    //Vec3 pos = player.getPosition(1.0f);
    //player.setPositionAndRotation(pos.xCoord + mx, pos.yCoord + my, pos.zCoord + mz, player.rotationYaw + yaw, player.rotationPitch + pitch);
    entity.move(MoverType.SELF, mx, my, mz);
    //p.setPositionAndRotation(p.posX + mx, p.posY + my, p.posZ + mz, p.rotationYaw, p.rotationPitch);
    this.reOrientEntityToAngle(entity, entity.rotationYaw + yaw, entity.rotationPitch + pitch);
}
项目:multishot    文件:Motion.java   
private void moveEntityCircular(Entity entity)
{
    if (entity == null)
    {
        Multishot.logger.fatal("movePlayerCircular(): player was null");
        return;
    }

    this.circleCurrentAngle += this.circleAngularVelocity;
    double x = this.circleCenter.getX() - Math.sin(this.circleCurrentAngle) * this.circleRadius;
    double z = this.circleCenter.getZ() + Math.cos(this.circleCurrentAngle) * this.circleRadius;
    x = (x - entity.posX);
    z = (z - entity.posZ);

    entity.move(MoverType.SELF, x, 0.0, z);
    //p.setPositionAndRotation(x, p.posY, z, p.rotationYaw, p.rotationPitch);

    // If we have a target point set, re-orient the player to look at the target point
    if (this.getUseTarget())
    {
        this.reOrientEntityToTargetPoint(entity, this.circleTarget);
    }
}
项目:enderutilities    文件:EntityFallingBlockEU.java   
private void updateMovement()
{
    if (this.hasNoGravity() == false)
    {
        this.motionY -= 0.04D;
    }

    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);

    this.motionX *= 0.98D;
    this.motionY *= 0.98D;
    this.motionZ *= 0.98D;
}
项目:OpenBlocks    文件:EntitySmoothMove.java   
public void update() {
    double dx = targetX - posX;
    double dy = targetY - posY;
    double dz = targetZ - posZ;

    final double lenSq = dx * dx + dy * dy + dz * dz;
    if (shouldJump(lenSq)) {
        setPositionRaw(targetX, targetY, targetZ);
        motionX = motionY = motionZ = 0;
    } else {
        if (lenSq > cutoff * cutoff) {
            double scale = cutoff / Math.sqrt(lenSq);
            dx *= scale;
            dy *= scale;
            dz *= scale;
        }

        move(MoverType.SELF, motionX + dx * damp, motionY + dy * damp, motionZ + dz * damp);
    }
}
项目:iChunUtil    文件:EntityBlock.java   
@Override
public void setSize(float width, float height)
{
    float f2 = this.width;
    this.width = width;
    this.height = height;
    if(blocks == null)
    {
        this.setEntityBoundingBox(new AxisAlignedBB(this.getEntityBoundingBox().minX, this.getEntityBoundingBox().minY, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().minX + (double)this.width, this.getEntityBoundingBox().minY + (double)this.height, this.getEntityBoundingBox().minZ + (double)this.width));
    }
    else
    {
        this.setEntityBoundingBox(new AxisAlignedBB(this.getEntityBoundingBox().minX, this.getEntityBoundingBox().minY, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().minX + (double)(blocks.length - 0.05F), this.getEntityBoundingBox().minY + (double)(blocks[0].length - 0.05F), this.getEntityBoundingBox().minZ + (double)(blocks[0][0].length - 0.05F)));
    }

    if(this.width > f2 && !this.firstUpdate && !this.world.isRemote)
    {
        this.move(MoverType.SELF, (double)(f2 - this.width), 0.0D, (double)(f2 - this.width));
    }
}
项目:pnc-repressurized    文件:TileEntityElevatorBase.java   
private void moveEntities(float moveBy) {
    AxisAlignedBB aabb = new AxisAlignedBB(getPos().getX(), getPos().getY() + 1, getPos().getZ(), getPos().getX() + 1, getPos().getY() + extension + 1, getPos().getZ() + 1);
    List<Entity> entityList = getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb);
    for (Entity entity : entityList) {
        if (entity instanceof EntityPlayer) {

        } else entity.move(MoverType.SELF, 0, moveBy + 0.05F, 0);
    }
}
项目:ClientAPI    文件:MixinEntityPlayerSP.java   
@Redirect(method = "move", at = @At(value = "INVOKE", target = "net/minecraft/client/entity/AbstractClientPlayer.move(Lnet/minecraft/entity/MoverType;DDD)V"))
private void move(AbstractClientPlayer player, MoverType type, double x, double y, double z) {
    MoveEvent event = new MoveEvent(type, x, y, z);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        return;

    super.move(type, event.getX(), event.getY(), event.getZ());
}
项目:WirelessRedstone    文件:EntityWirelessTracker.java   
public void moveEntityWithBounce(double bounceFactor)
{
    double dx = motionX;
    double dz = motionZ;

    move(MoverType.SELF, motionX, motionY, motionZ);
    setPosition(posX, posY, posZ);

    boolean isCollidedX = motionX != dx;
    boolean isCollidedZ = motionZ != dz;

    motionX = dx;
    motionZ = dz;

    if(isCollidedX)
    {
        motionX *= -bounceFactor;
        posX += Math.signum(motionX)*0.1;
    }
    if(isCollidedZ)
    {
        motionZ *= -bounceFactor;
        posZ += Math.signum(motionZ)*0.1;
    }

    pushOutOfBlocks(posX, posY + height / 2, posZ);
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@Override
public void move(MoverType type, double x, double y, double z) {
    if (m_realPlayer == null) {
        super.move(type, x, y, z);
    } else {
        syncToRealPlayer();
        m_realPlayer.move(type, x, y, z);
        syncPublicFieldsFromReal();
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@Override
public void move(MoverType type, double x, double y, double z) {
    if (m_realPlayer == null) {
        super.move(type, x, y, z);
    } else {
        m_realPlayer.move(type, x, y, z);
    }
}
项目:Solar    文件:EntityStaticItem.java   
@Override
public void onUpdate() {
    if(getItem().getItem().onEntityItemUpdate(this)) return;

    if(getItem().isEmpty() || (!world.isRemote && despawn != -1 && despawn-- == 0)) {
        setDead();
    } else {
        onEntityUpdate();

        prevPosX = posX;
        prevPosY = posY;
        prevPosZ = posZ;

        if(world.isRemote) noClip = true;
        move(MoverType.SELF, motionX, motionY, motionZ);

        float rest = this.rest;
        if (!noClip && onGround) {
            BlockPos pos = new BlockPos(MathHelper.floor(this.posX), MathHelper.floor(this.getEntityBoundingBox().minY) - 1, MathHelper.floor(this.posZ));
            IBlockState state = world.getBlockState(pos);
            rest = state.getBlock().getSlipperiness(state, world, pos, this) * 0.98F;
        }

        if (!hasNoGravity() && !onGround) {
            motionY -= 0.03999999910593033D;
        }
        motionX *= rest;
        motionY *= rest;
        motionZ *= rest;
        updateLogic();
    }
}
项目:Zombe-Modpack    文件:DummyPlayer.java   
@Override
public void moveEntity(MoverType t, double mx, double my, double mz) {
    if (this == getView()) {
        ZHandle.handle("beforeViewMove", new Vec3d(mx,my,mz));
        Vec3d motion =  new Vec3d(this.motionX, this.motionY, this.motionZ);
        super.moveEntity(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
        ZHandle.handle("afterViewMove", motion);
    } else {
        super.moveEntity(t, mx, my, mz);
    }
}
项目:Backmemed    文件:EntityArrow.java   
/**
 * Tries to move the entity towards the specified location.
 */
public void moveEntity(MoverType x, double p_70091_2_, double p_70091_4_, double p_70091_6_)
{
    super.moveEntity(x, p_70091_2_, p_70091_4_, p_70091_6_);

    if (this.inGround)
    {
        this.xTile = MathHelper.floor(this.posX);
        this.yTile = MathHelper.floor(this.posY);
        this.zTile = MathHelper.floor(this.posZ);
    }
}
项目:Backmemed    文件:EntityShulker.java   
/**
 * Tries to move the entity towards the specified location.
 */
public void moveEntity(MoverType x, double p_70091_2_, double p_70091_4_, double p_70091_6_)
{
    if (x == MoverType.SHULKER_BOX)
    {
        this.tryTeleportToNewPosition();
    }
    else
    {
        super.moveEntity(x, p_70091_2_, p_70091_4_, p_70091_6_);
    }
}
项目:Backmemed    文件:EntityPlayerSP.java   
/**
 * Tries to move the entity towards the specified location.
 */
public void moveEntity(MoverType x, double p_70091_2_, double p_70091_4_, double p_70091_6_)
{
    double d0 = this.posX;
    double d1 = this.posZ;
    super.moveEntity(x, p_70091_2_, p_70091_4_, p_70091_6_);
    this.updateAutoJump((float)(this.posX - d0), (float)(this.posZ - d1));
}
项目:Wizardry    文件:ArenaManager.java   
@SubscribeEvent
public void tickBoss(LivingEvent.LivingUpdateEvent event) {
    for (Arena arena : arenas) {
        if (event.getEntityLiving().getEntityId() != arena.getBossID()) continue;

        if (event.getEntityLiving().getDistance(arena.getCenter().getX() + 0.5, arena.getCenter().getY(), arena.getCenter().getZ() + 0.5) > arena.getRadius()) {
            event.getEntityLiving().move(MoverType.SELF, arena.getCenter().getX() + 0.5, arena.getCenter().getY() + 0.5, arena.getCenter().getZ() + 0.5);
        }
    }
}
项目:Wizardry    文件:EntityMoveEvent.java   
public EntityMoveEvent(Entity entity, MoverType type, double x, double y, double z) {
    this.entity = entity;
    this.type = type;
    this.x = x;
    this.y = y;
    this.z = z;
}
项目:TFICore    文件:EntityFuseRockPrimed.java   
public void onUpdate() {
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (!this.hasNoGravity()) {
        this.motionY -= 0.03999999910593033D;
    }

    this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9800000190734863D;
    this.motionY *= 0.9800000190734863D;
    this.motionZ *= 0.9800000190734863D;

    if (this.onGround) {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
        this.motionY *= -0.5D;
    }

    --this.fuse;

    if (this.fuse <= 0) {
        this.setDead();

        if (!this.world.isRemote) {
            this.explode();
        }
    }
    else {
        this.handleWaterMovement();

        this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
项目:TMT-Refraction    文件:EntityPlasma.java   
@Override
public void onUpdate() {
    super.onUpdate();
    //Minecraft.getMinecraft().player.sendChatMessage(ticksExisted + "");
    if (!world.isRemote)
        if (ticksExisted > 100) world.removeEntity(this);

    motionX = getDataManager().get(DATA_X) * 1.5;
    motionY = getDataManager().get(DATA_Y) * 1.5;
    motionZ = getDataManager().get(DATA_Z) * 1.5;

    move(MoverType.SELF, motionX, motionY, motionZ);
    if (getDataManager().get(DATA_COLLIDED) != isCollided) applyCollision(isCollided);
}
项目:Dark-Utilities    文件:EntityFakeTNT.java   
@Override
public void onUpdate () {

    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;
    this.motionY -= 0.03999999910593033D;
    this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9800000190734863D;
    this.motionY *= 0.9800000190734863D;
    this.motionZ *= 0.9800000190734863D;

    if (this.onGround) {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
        this.motionY *= -0.5D;
    }

    this.setFuse(this.getFuse() - 1);

    if (this.getFuse() <= 0) {
        this.setDead();

        if (!this.world.isRemote) {
            this.world.createExplosion(this, this.posX, this.posY + this.height / 16.0F, this.posZ, 0.0f, true);
        }
    }
    else {
        this.handleWaterMovement();
        this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
项目:TaleCraft    文件:EntityMovingBlock.java   
private void vanillaUpdateMod(){
    if (getBlock().getMaterial() == Material.AIR){
        this.setDead();
    }
    else{
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
        if (!this.hasNoGravity())
        {
            this.motionY -= 0.03999999910593033D;
        }
        if(onGround || no_gravity)this.motionY = 0;
        this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
        this.motionX *= 0.9800000190734863D;
        this.motionY *= 0.9800000190734863D;
        this.motionZ *= 0.9800000190734863D;

        if (!this.getEntityWorld().isRemote){
            if (this.onGround){
                if (this.getEntityWorld().isAirBlock(new BlockPos(this.posX, this.posY - 0.009999999776482582D, this.posZ))) //Forge: Don't indent below.
                if (BlockFalling.canFallThrough(this.getEntityWorld().getBlockState(new BlockPos(this.posX, this.posY - 0.009999999776482582D, this.posZ))) && !no_gravity){
                    this.onGround = false;
                    return;
                }
                this.motionX *= 0.699999988079071D;
                this.motionZ *= 0.699999988079071D;
                this.motionY *= -0.5D;
            }
        }
    }
}
项目:morecommands    文件:PatchEntityPlayerSP.java   
@Override
public void move(MoverType mt, double x, double y, double z) {
    if (this.freezeCam && Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityCamera) {
        ((EntityCamera) Minecraft.getMinecraft().getRenderViewEntity()).setFreezeCamera(0, 0, 0, this.freezeCamYaw, this.freezeCamPitch);
    }
    else if (this.freeCam && Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityCamera) {
        ((EntityCamera) Minecraft.getMinecraft().getRenderViewEntity()).setFreeCamera(x, y, z, this.rotationYaw, this.rotationPitch);
        return;
    }

    super.move(mt, x, y, z);
}
项目:Cyclic    文件:EntityGoldMinecart.java   
/**
 * Moved to allow overrides. This code handles minecart movement and speed capping when on a rail.
 */
@Override
public void moveMinecartOnRail(BlockPos pos) {
  double mX = this.motionX;
  double mZ = this.motionZ;
  if (this.isBeingRidden()) {
    mX *= DRAG_RIDDEN;
    mZ *= DRAG_RIDDEN;
  }
  double max = this.getMaxSpeed();
  mX = MathHelper.clamp(mX, -max, max);
  mZ = MathHelper.clamp(mZ, -max, max);
  this.move(MoverType.SELF, mX, 0.0D, mZ);
}
项目:AbyssalCraft    文件:EntityODBPrimed.java   
@Override
public void onUpdate()
{
    prevPosX = posX;
    prevPosY = posY;
    prevPosZ = posZ;
    motionY -= 0.03999999910593033D;
    move(MoverType.SELF, motionX, motionY, motionZ);
    motionX *= 0.9800000190734863D;
    motionY *= 0.9800000190734863D;
    motionZ *= 0.9800000190734863D;

    if (onGround)
    {
        motionX *= 0.699999988079071D;
        motionZ *= 0.699999988079071D;
        motionY *= -0.5D;
    }

    if (fuse-- <= 0)
    {
        setDead();

        explode();

    } else{
        handleWaterMovement();
        if(ACConfig.particleEntity)
            world.spawnParticle(EnumParticleTypes.PORTAL, posX, posY + 0.5D, posZ, 1.0D, 0.0D, 0.0D);
    }
}
项目:AbyssalCraft    文件:EntityODBcPrimed.java   
@Override
public void onUpdate()
{
    prevPosX = posX;
    prevPosY = posY;
    prevPosZ = posZ;
    motionY -= 0.03999999910593033D;
    move(MoverType.SELF, motionX, motionY, motionZ);
    motionX *= 0.9800000190734863D;
    motionY *= 0.9800000190734863D;
    motionZ *= 0.9800000190734863D;

    if (onGround)
    {
        motionX *= 0.699999988079071D;
        motionZ *= 0.699999988079071D;
        motionY *= -0.5D;
    }

    if (fuse-- <= 0)
    {
        setDead();

        explode();

    } else {
        handleWaterMovement();
        if(ACConfig.particleEntity)
            AbyssalCraft.proxy.spawnParticle("CorBlood", world, posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height - 0.25D, posZ + (rand.nextDouble() - 0.5D) * width, (rand.nextDouble() - 0.5D) * 100.0D, -rand.nextDouble(), (rand.nextDouble() - 0.5D) * 100.0D);
    }
}
项目:SecurityCraft    文件:EntityIMSBomb.java   
@Override
public void onUpdate(){
    if(!launching){
        super.onUpdate();
        return;
    }

    if(ticksFlying < launchHeight && launching){
        motionY = 0.35F;
        ticksFlying++;
        move(MoverType.SELF, motionX, motionY, motionZ);
    }else if(ticksFlying >= launchHeight && launching)
        setTarget();
}
项目:SecurityCraft    文件:EntityBouncingBetty.java   
/**
 * Called to update the entity's position/logic.
 */
@Override
public void onUpdate()
{
    prevPosX = posX;
    prevPosY = posY;
    prevPosZ = posZ;
    motionY -= 0.03999999910593033D;
    move(MoverType.SELF, motionX, motionY, motionZ);
    motionX *= 0.9800000190734863D;
    motionY *= 0.9800000190734863D;
    motionZ *= 0.9800000190734863D;

    if (onGround)
    {
        motionX *= 0.699999988079071D;
        motionZ *= 0.699999988079071D;
        motionY *= -0.5D;
    }

    if (fuse-- <= 0)
    {
        setDead();

        if (!world.isRemote)
            explode();
    }
    else
        world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D);
}
项目:SecurityCraft    文件:EntityIMSBomb.java   
@Override
public void onUpdate(){
    if(!launching){
        super.onUpdate();
        return;
    }

    if(ticksFlying < launchHeight && launching){
        motionY = 0.35F;
        ticksFlying++;
        move(MoverType.SELF, motionX, motionY, motionZ);
    }else if(ticksFlying >= launchHeight && launching)
        setTarget();
}
项目:SecurityCraft    文件:EntityBouncingBetty.java   
/**
 * Called to update the entity's position/logic.
 */
@Override
public void onUpdate()
{
    prevPosX = posX;
    prevPosY = posY;
    prevPosZ = posZ;
    motionY -= 0.03999999910593033D;
    move(MoverType.SELF, motionX, motionY, motionZ);
    motionX *= 0.9800000190734863D;
    motionY *= 0.9800000190734863D;
    motionZ *= 0.9800000190734863D;

    if (onGround)
    {
        motionX *= 0.699999988079071D;
        motionZ *= 0.699999988079071D;
        motionY *= -0.5D;
    }

    if (fuse-- <= 0)
    {
        setDead();

        if (!world.isRemote)
            explode();
    }
    else
        world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D);
}
项目:OpenBlocks    文件:BrickManager.java   
private static EntityItem createBrick(Entity dropper) {
    ItemStack brick = new ItemStack(Items.BRICK);
    EntityItem drop = ItemUtils.createDrop(dropper, brick);
    double rotation = Math.toRadians(dropper.rotationYaw) - Math.PI / 2;
    double dx = Math.cos(rotation);
    double dz = Math.sin(rotation);

    drop.move(MoverType.SELF, 0.75 * dx, 0.5, 0.75 * dz);

    drop.motionX = 0.5 * dx;
    drop.motionY = 0.2;
    drop.motionZ = 0.5 * dz;

    return drop;
}