Package com.bergerkiller.bukkit.common.nbt

Examples of com.bergerkiller.bukkit.common.nbt.CommonTagCompound.containsKey()


      // 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"));
View Full Code Here


      NBTUtil.loadFoodMetaData(EntityHumanRef.foodData.get(playerHandle), data);
      NBTUtil.loadInventory(player.getEnderChest(), data.createList("EnderItems"));
     
      // Load Mob Effects
      HashMap<Integer, Object> effects = EntityHumanRef.mobEffects.get(playerHandle);
      if (data.containsKey("ActiveEffects")) {
        CommonTagList taglist = data.createList("ActiveEffects");
        for (int i = 0; i < taglist.size(); ++i) {
          Object mobEffect = NBTUtil.loadMobEffect((CommonTagCompound) taglist.get(i));
          effects.put(MobEffectRef.effectId.get(mobEffect), mobEffect);
        }
View Full Code Here

        tagcompound.putListValues(DATA_TAG_LASTROT, loc.getYaw(), loc.getPitch());
      } else {
        // Append original last position (if available) to the data
        if (destFile.exists()) {
          CommonTagCompound data = read(destFile, human);
          if (data.containsKey(DATA_TAG_LASTPOS)) {
            tagcompound.put(DATA_TAG_LASTPOS, data.get(DATA_TAG_LASTPOS));
          }
          if (data.containsKey(DATA_TAG_LASTROT)) {
            tagcompound.put(DATA_TAG_LASTROT, data.get(DATA_TAG_LASTROT));
          }
View Full Code Here

        if (destFile.exists()) {
          CommonTagCompound data = read(destFile, human);
          if (data.containsKey(DATA_TAG_LASTPOS)) {
            tagcompound.put(DATA_TAG_LASTPOS, data.get(DATA_TAG_LASTPOS));
          }
          if (data.containsKey(DATA_TAG_LASTROT)) {
            tagcompound.put(DATA_TAG_LASTROT, data.get(DATA_TAG_LASTROT));
          }
        }

        // Write the Last Pos/Rot to the official world file instead
View Full Code Here

                  editcount++;
                  locations[i] = 0;
                  MyWorlds.plugin.log(Level.WARNING, "Invalid tag compound at chunk " + chunkX + "/" + chunkZ);
                } else {
                  //correct location?
                  if (comp.containsKey("Level")) {
                    CommonTagCompound level = comp.createCompound("Level");
                    int xPos = level.getValue("xPos", Integer.MIN_VALUE);
                    int zPos = level.getValue("zPos", Integer.MIN_VALUE);
                    //valid coordinates?
                    if (xPos != chunkX || zPos != chunkZ) {
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.