Search in sources :

Example 1 with EntityAirSled

use of am2.entities.EntityAirSled in project ArsMagica2 by Mithion.

the class ClientProxy method sendLocalMovementData.

@Override
public void sendLocalMovementData(EntityLivingBase ent) {
    if (ent == Minecraft.getMinecraft().thePlayer) {
        if (ent.worldObj.isRemote && ent.ridingEntity instanceof EntityAirSled) {
            EntityClientPlayerMP player = (EntityClientPlayerMP) ent;
            player.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(player.rotationYaw, player.rotationPitch, player.onGround));
            player.sendQueue.addToSendQueue(new C0CPacketInput(player.moveStrafing, player.moveForward, player.movementInput.jump, player.movementInput.sneak));
        }
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) C0CPacketInput(net.minecraft.network.play.client.C0CPacketInput) EntityAirSled(am2.entities.EntityAirSled) C03PacketPlayer(net.minecraft.network.play.client.C03PacketPlayer)

Example 2 with EntityAirSled

use of am2.entities.EntityAirSled in project ArsMagica2 by Mithion.

the class ItemAirSled method onItemUseFirst.

@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    if (!world.isRemote) {
        EntityAirSled sled = new EntityAirSled(world);
        sled.setPosition(x + hitX, y + hitY + 0.5, z + hitZ);
        world.spawnEntityInWorld(sled);
        player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
        return true;
    }
    return false;
}
Also used : EntityAirSled(am2.entities.EntityAirSled)

Aggregations

EntityAirSled (am2.entities.EntityAirSled)2 EntityClientPlayerMP (net.minecraft.client.entity.EntityClientPlayerMP)1 C03PacketPlayer (net.minecraft.network.play.client.C03PacketPlayer)1 C0CPacketInput (net.minecraft.network.play.client.C0CPacketInput)1