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

Examples of org.spout.vanilla.component.entity.substance.Substance


        final Living living = entity.get(Living.class);
        if (name.equalsIgnoreCase("human")) {
          ((Human) living).setName(args.popString("disp_name"));
        }
      } else if (Substance.class.isAssignableFrom(clazz)) {
        final Substance substance = entity.get(Substance.class);
        switch (ObjectType.valueOf(name.toUpperCase())) {
          case ITEM:
            Material item = VanillaArgumentTypes.popMaterial("item", args);
            ((Item) substance).setItemStack(new ItemStack(item, 1));
            break;
View Full Code Here


  }

  public void onInteract(Entity entity, Action type, float mass) {
    super.onInteract(entity, type);
    if (type == Action.RIGHT_CLICK) {
      Substance item = this.spawnEntity(entity, new Vector3f(0, 1.6f, 0));
      PhysicsComponent physics = item.getOwner().getPhysics();
      physics.activate(mass, new SphereShape(1f), false, true);
      if (item instanceof Projectile) {
        ((Projectile) item).setShooter(entity);
      }
      physics.force(entity.getPhysics().getRotation().getDirection().mul(getLaunchForce()));
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.substance.Substance

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.