Package org.spout.api.entity

Examples of org.spout.api.entity.Entity


    return false;
  }

  @Override
  public void onAttached() {
    Entity owner = getOwner();
    if (!(owner instanceof Player)) {
      throw new IllegalStateException("Effects component may only be attached to players.");
    }
    player = (Player) owner;
  }
View Full Code Here


  public void testHealthComponent() throws IOException {
    TestVanilla.init();
    VanillaConfiguration config = TestVanilla.getInstance().getConfig();
    VanillaConfiguration.PLAYER_SURVIVAL_ENABLE_HEALTH.setConfiguration(config);

    Entity entity = EntityMocker.mockEntity();
    Health health = entity.add(Health.class);

    health.setMaxHealth(15);
    assertEquals(15.0f, health.getMaxHealth(), 0.0f);
    assertEquals(1.0f, health.getHealth(), 0.0f);
View Full Code Here

public class EntityRelativePositionHandler extends MessageHandler<EntityRelativePositionMessage> {
  @Override
  public void handleClient(ClientSession session, EntityRelativePositionMessage message) {
    Player player = session.getPlayer();
    World world = player.getWorld();
    Entity entity = world.getEntity(message.getEntityId());
    entity.getPhysics().translate(new Vector3f(message.getDeltaX(), message.getDeltaY(), message.getDeltaZ()));
  }
View Full Code Here

public class EntityTeleportHandler extends MessageHandler<EntityTeleportMessage> {
  @Override
  public void handleClient(ClientSession session, EntityTeleportMessage message) {
    Player player = session.getPlayer();
    World world = player.getWorld();
    Entity entity = session.getPlayer();//world.getEntity(message.getEntityId());
    entity.getPhysics().setPosition(new Point(world, message.getX(), message.getY(), message.getZ()));
    entity.getPhysics().rotate(Quaternionf.fromAxesAnglesDeg(message.getPitch(), message.getRotation(), 0));
  }
View Full Code Here

TOP

Related Classes of org.spout.api.entity.Entity

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.