Package org.spout.vanilla.component.entity.substance.projectile

Examples of org.spout.vanilla.component.entity.substance.projectile.Potion


  }

  @Override
  public void onInteract(Entity entity, Action action) {
    if (this.isSplash()) {
      Potion item = entity.getWorld().createEntity(entity.getPhysics().getPosition().add(0, 1.6f, 0)).add(Potion.class);
      item.setShooter(entity);
      item.setPotion(this);
      PhysicsComponent physics = item.getOwner().getPhysics();
      physics.activate(1f, new SphereShape(0.3f), false, true);
      entity.getWorld().spawnEntity(item.getOwner());
      physics.impulse(entity.getPhysics().getRotation().getDirection().mul(55)); //TODO: Need real parameters
    }
  }
View Full Code Here


  }

  @Override
  public List<Message> getSpawnMessages(Entity entity, RepositionManager rm) {
    List<Message> messages = new ArrayList<>();
    Potion potion = entity.add(Potion.class);
    messages.add(new EntityObjectMessage(entity, (byte) typeId, potion.getPotion().getData(), rm));
    return messages;
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.substance.projectile.Potion

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.