Package de.kumpelblase2.remoteentities.api

Examples of de.kumpelblase2.remoteentities.api.RemoteEntity.save()


   
    //Some serializers allow single entities to be saved, i.e. the YML serializer
    //But first, we need to create an entitiy.
    RemoteEntity entity = this.npcManager.createEntity(RemoteEntityType.Zombie, Bukkit.getWorld("world").getSpawnLocation());
    //Now we can just call the save method. Keep in mind that it will not work when the serializer doesn't support single entity serialization
    entity.save();
   
    //To load the entities we saved, you can just do this:
    this.npcManager.loadEntities();
    //Now all the entities should be back like you never removed them
  }
View Full Code Here


  public boolean save()
  {
    if(this.getManager().getSerializer() instanceof ISingleEntitySerializer)
    {
      ISingleEntitySerializer serializer = (ISingleEntitySerializer)this.getManager().getSerializer();
      serializer.save(serializer.prepare(this));
      return true;
    }

    return false;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.