Package com.bergerkiller.bukkit.common.entity.type

Examples of com.bergerkiller.bukkit.common.entity.type.CommonPlayer


      // If not enabled, only do the post-load logic
      postLoad(player);
      return;
    }
    try {
      CommonPlayer commonPlayer = CommonEntity.get(player);
      Object playerHandle = Conversion.toEntityHandle.convert(player);
      File source = getSaveFile(player);
      CommonTagCompound data = read(source, player);

      // First, clear previous player information when loading involves adding new elements
      clearEffects(player);

      // Refresh attributes
      if (data.containsKey("Attributes")) {
        NBTUtil.loadAttributes(player, data.get("Attributes", CommonTagList.class));
      }

      // Load the data
      NBTUtil.loadInventory(player.getInventory(), data.createList("Inventory"));
      EntityHumanRef.exp.set(playerHandle, data.getValue("XpP", 0.0f));
      EntityHumanRef.expLevel.set(playerHandle, data.getValue("XpLevel", 0));
      EntityHumanRef.expTotal.set(playerHandle, data.getValue("XpTotal", 0));

      if (Common.MC_VERSION.equals("1.5.2")) {
        commonPlayer.setHealth(data.getValue("Health", (int) commonPlayer.getMaxHealth()));
      } else {
        commonPlayer.setHealth(data.getValue("HealF", (float) commonPlayer.getMaxHealth()));
      }
     
      // Respawn position
      String spawnWorld = data.getValue("SpawnWorld", "");
      IntVector3 spawn = null;
View Full Code Here


      final EntityTracker tracker = WorldUtil.getTracker(getWorld());
      tracker.stopTracking(entity);

      // Destroy packets are queued: Make sure to send them RIGHT NOW
      for (Player bukkitPlayer : WorldUtil.getPlayers(getWorld())) {
        CommonPlayer player = get(bukkitPlayer);
        if (player != null) {
          player.flushEntityRemoveQueue();
        }
      }

      // Teleport
      succ = entity.teleport(location, cause);
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.common.entity.type.CommonPlayer

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.