Package de.kumpelblase2.remoteentities.api.thinking.goals

Examples of de.kumpelblase2.remoteentities.api.thinking.goals.DesirePanic


  {
    if(this.getEntityHandle() instanceof EntityHorse)
      ((EntityHorse)this.getEntityHandle()).g((EntityHuman)((EntityHorse)this.getEntityHandle()).passenger);
    else
    {
      RidingFeature ridingFeature = this.getRemoteEntity().getFeatures().getFeature(RidingFeature.class);
      ridingFeature.setRideable(true);
      if(ridingFeature instanceof TamedRidingFeature)
        ((TamedRidingFeature)ridingFeature).tame((Player)this.getEntityHandle().passenger.getBukkitEntity());
    }
  }
View Full Code Here


 
  @EventHandler
  public void onJoin(PlayerJoinEvent inEvent) throws Exception
  {
    RemoteEntity entity = npcManager.createNamedEntity(RemoteEntityType.Human, inEvent.getPlayer().getLocation(), "test");
    TamingFeature feature = new RemoteTamingFeature(entity);
    feature.tame(inEvent.getPlayer());
    entity.getFeatures().addFeature(feature);
    entity.getMind().addMovementDesire(new DesireFollowTamer(entity, 5, 15), entity.getMind().getHighestMovementPriority() + 1);
  }
View Full Code Here

    EntityLiving entity = this.getEntityHandle();
    if(!(entity instanceof EntityVillager))
    {
      if(this.getRemoteEntity().getFeatures().hasFeature(TradingFeature.class))
      {
        TradingFeature feature = this.getRemoteEntity().getFeatures().getFeature(TradingFeature.class);
        if(feature.getTradingPlayers().size() != 0)
        {
          this.m_target = ((CraftLivingEntity)feature.getTradingPlayers().get(feature.getTradingPlayers().size() - 1)).getHandle();
          return true;
        }
      }

      return false;
View Full Code Here

        else if(this.parameters[i].special.equals("manager"))
          values[i] = inEntity.getManager();
        else
          values[i] = EntityData.objectParser.deserialize(this.parameters[i]);
      }
      Desire d = con.newInstance(values);
      return new DesireItem(d, this.priority);
    }
    catch(Exception e)
    {
      RemoteEntities.getInstance().getLogger().warning("Error when trying to deserialize desire with type " + this.type + ": ");
View Full Code Here

      context.atLocation(inData.location.toBukkitLocation());

    RemoteEntity entity = context.create();
    for(DesireData data : inData.movementDesires)
    {
      DesireItem item = data.create(entity);
      entity.getMind().addMovementDesire(item.getDesire(), item.getPriority());
    }

    for(DesireData data : inData.actionDesires)
    {
      DesireItem item = data.create(entity);
      entity.getMind().addTargetingDesire(item.getDesire(), item.getPriority());
    }

    for(BehaviorData data : inData.behaviors)
    {
      entity.getMind().addBehaviour(data.create(entity));
View Full Code Here

    this.speed = inEntity.getSpeed();
    this.pathfindingRange = inEntity.getPathfindingRange();
    List<DesireData> action = new ArrayList<DesireData>();
    for(int i = 0; i < inEntity.getMind().getTargetingDesires().size(); i++)
    {
      DesireItem desire = inEntity.getMind().getTargetingDesires().get(i);
      if(!desire.getDesire().getClass().isAnnotationPresent(IgnoreSerialization.class))
        action.add(new DesireData(desire));
    }

    this.actionDesires = action.toArray(new DesireData[action.size()]);
    List<DesireData> movement = new ArrayList<DesireData>();
    for(int i = 0; i < inEntity.getMind().getMovementDesires().size(); i++)
    {
      DesireItem desire = inEntity.getMind().getMovementDesires().get(i);
      if(!desire.getDesire().getClass().isAnnotationPresent(IgnoreSerialization.class))
        movement.add(new DesireData(desire));
    }

    this.movementDesires = movement.toArray(new DesireData[movement.size()]);
    this.behaviors = new BehaviorData[inEntity.getMind().getBehaviours().size()];
View Full Code Here

          values[i] = inEntity.getManager();
        else
          values[i] = EntityData.objectParser.deserialize(this.parameters[i]);
      }
      Desire d = con.newInstance(values);
      return new DesireItem(d, this.priority);
    }
    catch(Exception e)
    {
      RemoteEntities.getInstance().getLogger().warning("Error when trying to deserialize desire with type " + this.type + ": ");
      RemoteEntities.getInstance().getLogger().warning(e.getMessage());
View Full Code Here

  public static DesireItem[] getDefaultMovementDesires()
  {
    try
    {
      return new DesireItem[] {
          new DesireItem(new DesireSwim(), 0),
          new DesireItem(new DesirePanic(1.25D), 1),
          new DesireItem(new DesireBreed(), 2),
          new DesireItem(new DesireTempt(Item.b(Items.WHEAT), false, 1.1D), 3),
          new DesireItem(new DesireFollowParent(), 4),
          new DesireItem(new DesireEatGrass(), 5),
          new DesireItem(new DesireWanderAround(), 6),
          new DesireItem(new DesireLookAtNearest(EntityHuman.class, 6), 7),
          new DesireItem(new DesireLookRandomly(), 8)
      };
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

  public static DesireItem[] getDefaultMovementDesires()
  {
    try
    {
      return new DesireItem[] {
          new DesireItem(new DesireSwim(), 1),
          new DesireItem(new DesirePanic(2.0D), 1),
          new DesireItem(new DesireBreed(), 2),
          new DesireItem(new DesireTempt(Item.b(Items.WHEAT), false, 1.25D), 3),
          new DesireItem(new DesireFollowParent(1.25D), 4),
          new DesireItem(new DesireWanderAround(), 5),
          new DesireItem(new DesireLookAtNearest(EntityHuman.class, 6), 6),
          new DesireItem(new DesireLookRandomly(), 7)
      };
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

  public static DesireItem[] getDefaultMovementDesires()
  {
    try
    {
      return new DesireItem[] {
          new DesireItem(new DesireSwim(), 0),
          new DesireItem(new DesirePanic(2.0D), 1),
          new DesireItem(new DesireBreed(), 2),
          new DesireItem(new DesireTempt(Item.b(Items.WHEAT), false, 1.25D), 3),
          new DesireItem(new DesireFollowParent(1.25D), 4),
          new DesireItem(new DesireWanderAround(), 5),
          new DesireItem(new DesireLookAtNearest(EntityHuman.class, 6), 6),
          new DesireItem(new DesireLookRandomly(), 7)
      };
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of de.kumpelblase2.remoteentities.api.thinking.goals.DesirePanic

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.