Package org.spout.vanilla.component.entity.living

Examples of org.spout.vanilla.component.entity.living.Human


    }

    Player holder = session.getPlayer();

    holder.getPhysics().setTransform(new Transform(holder.getPhysics().getPosition(), Quaternionf.fromAxesAnglesDeg(message.getPitch(), message.getYaw(), 0), holder.getPhysics().getScale()), false);
    Human human = holder.get(Human.class);
    if (human != null) {
      human.setOnGround(message.isOnGround());
      human.getHead().setOrientation(message.getRotation());
    }
  }
View Full Code Here


  @Override
  public void handleClient(ClientSession session, PlayerLookMessage message) {
    Player holder = session.getPlayer();

    holder.getPhysics().setRotation(Quaternionf.fromAxesAnglesDeg(message.getPitch(), message.getYaw(), 0));
    Human human = holder.get(Human.class);
    if (human != null) {
      human.setOnGround(message.isOnGround());
      human.getHead().setOrientation(message.getRotation());
    }
  }
View Full Code Here

  @Override
  public List<Message> getSpawnMessages(Entity entity, RepositionManager rm) {

    List<Message> messages = new ArrayList<Message>(6);

    Human human = entity.add(Human.class);

    int id = entity.getId();
    int x = VanillaByteBufUtils.protocolifyPosition(rm.convertX(entity.getPhysics().getPosition().getX()));
    int y = VanillaByteBufUtils.protocolifyPosition(rm.convertY(entity.getPhysics().getPosition().getY()));
    int z = VanillaByteBufUtils.protocolifyPosition(rm.convertZ(entity.getPhysics().getPosition().getZ()));
    final Vector3f axesAngles = entity.getPhysics().getRotation().getAxesAngleDeg();
    int r = VanillaByteBufUtils.protocolifyYaw(axesAngles.getY());
    int p = VanillaByteBufUtils.protocolifyPitch(axesAngles.getX());

    int item = 0;
    Slot hand = PlayerUtil.getHeldSlot(entity);
    if (hand != null && hand.get() != null) {
      item = hand.get().getMaterial().getId();
    }

    // Spawn message
    messages.add(new PlayerSpawnMessage(id, human.getName(), x, y, z, r, p, item, getSpawnParameters(entity)));

    // Armor
    EntityInventory inventory = entity.get(EntityInventory.class);
    final ItemStack boots, leggings, chestplate, helmet, held;
    if (inventory == null) {
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.living.Human

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.