Examples of RemoteEntitySpawnEvent


Examples of de.kumpelblase2.remoteentities.api.events.RemoteEntitySpawnEvent

  public void spawn(Location inLocation)
  {
    if(this.isSpawned())
      return;

    RemoteEntitySpawnEvent event = new RemoteEntitySpawnEvent(this, inLocation);
    Bukkit.getPluginManager().callEvent(event);
    if(event.isCancelled())
      return;

    inLocation = event.getSpawnLocation();
    WorldServer worldServer = ((CraftWorld)inLocation.getWorld()).getHandle();
    UUID uuid = UUID.nameUUIDFromBytes(("NPC:" + this.getID() + this.getName()).getBytes(Charsets.UTF_8));
    GameProfile profile = new GameProfile(uuid.toString().replaceAll("-", ""), this.getName());
    this.m_entity = new RemotePlayerEntity(worldServer.getMinecraftServer(), worldServer, profile, new PlayerInteractManager(worldServer), this);
    worldServer.addEntity(m_entity);
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.