public static void storeSoulboundItemsForRespawn(EntityPlayer player) {
    if (soulbound_Storage.containsKey(player.getDisplayName()))
      soulbound_Storage.remove(player.getDisplayName());

    HashMap<Integer, ItemStack> soulboundItems = new HashMap<Integer, ItemStack>();

    int slotCount = 0;
    for (ItemStack stack : player.inventory.mainInventory) {
      int soulbound_level =
          EnchantmentHelper.getEnchantmentLevel(AMEnchantments.soulbound.effectId, stack);
      if (soulbound_level > 0) {
        soulboundItems.put(slotCount, stack.copy());
        player.inventory.setInventorySlotContents(slotCount, null);
      }
      slotCount++;
    }
    slotCount = 0;
    for (ItemStack stack : player.inventory.armorInventory) {
      int soulbound_level =
          EnchantmentHelper.getEnchantmentLevel(AMEnchantments.soulbound.effectId, stack);
      if (soulbound_level > 0 || ArmorHelper.isInfusionPreset(stack, GenericImbuement.soulbound)) {
        soulboundItems.put(slotCount + player.inventory.mainInventory.length, stack.copy());
        player.inventory.setInventorySlotContents(
            slotCount + player.inventory.mainInventory.length, null);
      }
      slotCount++;
    }

    soulbound_Storage.put(player.getDisplayName(), soulboundItems);
  }
 @Override
 public boolean onBlockActivated(
     World world,
     int x,
     int y,
     int z,
     EntityPlayer player,
     int par6,
     float par7,
     float par8,
     float par9) {
   TileEntity tileEntity = world.getTileEntity(x, y, z);
   if (tileEntity != null && tileEntity instanceof TileVendor) {
     TileVendor tileVendor = (TileVendor) world.getTileEntity(x, y, z);
     EntityPlayer playerTest = world.getPlayerEntityByName(tileVendor.playerName);
     if (playerTest == null || !tileVendor.isUseableByPlayer(playerTest)) {
       tileVendor.inUse = false;
     }
     ;
     if (tileVendor.inUse && !player.getDisplayName().contentEquals(tileVendor.playerName)) {
       if (!world.isRemote) {
         player.addChatMessage(
             new ChatComponentText(StatCollector.translateToLocal("chat.warning.inuse")));
       }
       return true;
     } else {
       player.openGui(UniversalCoins.instance, 0, world, x, y, z);
       tileVendor.playerName = player.getDisplayName();
       tileVendor.inUse = true;
       tileVendor.updateCoinsForPurchase();
       return true;
     }
   }
   return false;
 }
Exemple #3
0
  public void func_150873_a(EntityPlayer p_150873_1_, StatBase p_150873_2_, int p_150873_3_) {
    int var4 = p_150873_2_.isAchievement() ? this.writeStat(p_150873_2_) : 0;
    super.func_150873_a(p_150873_1_, p_150873_2_, p_150873_3_);
    this.field_150888_e.add(p_150873_2_);

    if (p_150873_2_.isAchievement() && var4 == 0 && p_150873_3_ > 0) {
      this.field_150886_g = true;

      if (this.field_150890_c.isAnnouncingPlayerAchievements()) {
        this.field_150890_c
            .getConfigurationManager()
            .sendChatMsg(
                new ChatComponentTranslation(
                    "chat.type.achievement",
                    new Object[] {p_150873_1_.getDisplayName(), p_150873_2_.func_150955_j()}));
      }
    }

    if (p_150873_2_.isAchievement() && var4 > 0 && p_150873_3_ == 0) {
      this.field_150886_g = true;

      if (this.field_150890_c.isAnnouncingPlayerAchievements()) {
        this.field_150890_c
            .getConfigurationManager()
            .sendChatMsg(
                new ChatComponentTranslation(
                    "chat.type.achievement.taken",
                    new Object[] {p_150873_1_.getDisplayName(), p_150873_2_.func_150955_j()}));
      }
    }
  }
Exemple #4
0
  @SuppressWarnings({"unchecked", "ConstantConditions"})
  @Command(
      aliases = "pm",
      desc = "Send private message to target player.",
      usage = "/pm <target player> <message>")
  public void sendPm(@Sender EntityPlayer sender, String target, @Text String message) {

    try {
      UserId userId = profileService.findUserId(target);
      if (!Objects.equals(sender.getDisplayName(), userId.getEntityPlayer().getDisplayName())) {
        userId
            .getEntityPlayer()
            .addChatMessage(
                new ChatComponentText(
                    String.format(
                        "%s(%s - Message from %s%s: %s)",
                        EnumChatFormatting.GRAY,
                        formattedDate,
                        sender.getDisplayName(),
                        EnumChatFormatting.GRAY,
                        message.trim())));
        recipients.put(sender.getUniqueID(), profileService.findUserId(target));
      }
      if (Objects.equals(sender.getDisplayName(), userId.getEntityPlayer().getDisplayName())) {
        sender.addChatMessage(Messages.error(tr("whisper.pm.same-player.error")));
      }
    } catch (ProfileNotFoundException | NullPointerException e) {
      sender.addChatMessage(Messages.error(tr("whisper.pm.no-such-player.error")));
    } catch (ProfileLookupException ignored) {
    }
  }
  public void renderNitroAndSpeed(
      RenderGameOverlayEvent.Pre event, int width, int height, EntityPlayer player) {
    int nitro =
        TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName()) == null
            ? 0
            : TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName());
    int speed =
        (int)
            ((TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName()) == null
                    ? 0
                    : TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName()))
                * 100);
    int i = TFPlayerData.getTransformationTimer(player) * 30;

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0F, 0F, 0F, 0.3F);
    drawTexturedModalRect(5 - i, height - 17, 0, 0, 202, 12);
    drawTexturedModalRect(5 - i, height - 25, 0, 0, 202, 6);
    GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F);
    drawTexturedModalRect(6 - i, height - 16, 0, 0, (int) (nitro * 1.25F), 10);
    GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);
    drawTexturedModalRect(6 - i, height - 24, 0, 0, (int) (speed * 1F), 4);
    GL11.glEnable(GL11.GL_TEXTURE_2D);

    drawCenteredString(mc.fontRenderer, "Nitro", 106 - i, height - 15, 0xffffff);
    drawCenteredString(mc.fontRenderer, speed + " km/h", 106 - i, height - 26, 0xffffff);
  }
Exemple #6
0
 /**
  * Subtracts the thirst for the specified player Used on drinking
  *
  * @param player
  * @param amount
  */
 public void subtractThirst(EntityPlayer player, int amount) {
   int playerThirst = thirstMap.get(player.getDisplayName());
   playerThirst = playerThirst - amount;
   if (playerThirst < 0) {
     playerThirst = 0;
   }
   thirstMap.put(player.getDisplayName(), playerThirst);
   if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
     ChatHandler.chatConfirmation(player, "Ahh, much better.");
   }
 }
  public int getAAL(EntityPlayer thePlayer) {
    try {
      thePlayer.getDisplayName();
    } catch (Throwable t) {
      return 0;
    }

    if (aals == null || clls == null) populateAALList();
    if (aals.containsKey(thePlayer.getDisplayName().toLowerCase()))
      return aals.get(thePlayer.getDisplayName().toLowerCase());
    return 0;
  }
  public static void storeSoulboundItemForRespawn(EntityPlayer player, ItemStack stack) {
    if (!soulbound_Storage.containsKey(player.getDisplayName())) return;

    HashMap<Integer, ItemStack> soulboundItems = soulbound_Storage.get(player.getDisplayName());

    int slotTest = 0;
    while (soulboundItems.containsKey(slotTest)) {
      slotTest++;
      if (slotTest == player.inventory.mainInventory.length)
        slotTest += player.inventory.armorInventory.length;
    }

    soulboundItems.put(slotTest, stack);
  }
Exemple #9
0
  public void serveMotd(EntityPlayer player) {

    for (String line : motd) {
      line = line.replace("$PLAYER$", player.getDisplayName());
      player.addChatComponentMessage(ChatUtils.getChatComponent(line, EnumChatFormatting.WHITE));
    }
  }
  /** allows items to add custom lines of information to the mouseover description */
  @Override
  public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {

    if (NBTHelper.getBoolean(itemStack, "isSet")) {
      list.remove("Right Click to examine text");
      // String owner = NBTHelper.getString(itemStack, "owner");
      // String command = NBTHelper.getString(itemStack, "command");

      list.add("Owner: " + NBTHelper.getString(itemStack, "owner"));
      if (NBTHelper.getString(itemStack, "owner").equals(player.getDisplayName())) {
        list.add(EnumChatFormatting.GREEN + "Command:" + NBTHelper.getString(itemStack, "command"));
      } else {
        list.add(
            EnumChatFormatting.RED
                + "Command: "
                + EnumChatFormatting.OBFUSCATED
                + NBTHelper.getString(itemStack, "command"));
      }
    } else {
      list.add("Right Click to examine text");
    }
    /*
    String owner = itemStack.stackTagCompound.getString("owner");
    int code = itemStack.stackTagCompound.getInteger("code");
    list.add("owner: " + owner);
    if (owner.equals(player.username)) {
        list.add(EnumChatFormatting.GREEN + "code: " + code);
    } else {
        list.add(EnumChatFormatting.RED + "code: "
                + EnumChatFormatting.OBFUSCATED + code);
    }
    */

  }
  private void drawPlanetInfo(Planet planet) {
    glTranslated(0, planet.getSize() * 0.13f + 0.05f, 0);
    glScaled(0.005, 0.005, 0.005);
    glRotated(180, 0, 0, 1);
    if (GalaxyClient.getInstance().canSeePlanetInfo(planet, Minecraft.getMinecraft().thePlayer)) {
      int width = Minecraft.getMinecraft().fontRenderer.getStringWidth(planet.getName());
      Minecraft.getMinecraft()
          .fontRenderer
          .drawString(planet.getName(), -width / 2, 0, Planet.getGuiColor(planet).getColor());

      if (planet.isHomeworld(Minecraft.getMinecraft().thePlayer)) {
        width = Minecraft.getMinecraft().fontRenderer.getStringWidth("[Home]");
        Minecraft.getMinecraft()
            .fontRenderer
            .drawString(EnumChatFormatting.GOLD + "[Home]", -width / 2, -10, 0xFFFFFF);
      }
    } else {
      int width =
          Minecraft.getMinecraft().standardGalacticFontRenderer.getStringWidth(planet.getName());
      Minecraft.getMinecraft()
          .standardGalacticFontRenderer
          .drawString(planet.getName(), -width / 2, 0, Planet.getGuiColor(planet).getColor());

      if (planet.hasOwner()) {
        EntityPlayer owner = Minecraft.getMinecraft().theWorld.func_152378_a(planet.getOwnerUUID());
        if (owner != null) {
          String info = String.format("[%s]", owner.getDisplayName());
          width = Minecraft.getMinecraft().fontRenderer.getStringWidth(info);
          Minecraft.getMinecraft()
              .fontRenderer
              .drawString(EnumChatFormatting.GOLD + info, -width / 2, -10, 0xFFFFFF);
        }
      }
    }
  }
 public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
   String ownerName = ((TileVendorBlock) world.getTileEntity(x, y, z)).blockOwner;
   if (player.getDisplayName().equals(ownerName)) {
     this.setHardness(0.3F);
   } else {
     this.setHardness(-1.0F);
   }
 }
Exemple #13
0
 public boolean actionUnSeal(int tab, EntityPlayer player) {
   NBTTagCompound nbt = new NBTTagCompound();
   nbt.setBoolean("seal", false);
   nbt.setByte("tab", (byte) tab);
   nbt.setString("player", player.getDisplayName());
   this.broadcastPacketInRange(this.createDataPacket(nbt));
   sealed = false;
   this.worldObj.func_147479_m(xCoord, yCoord, zCoord);
   return true;
 }
  @Override
  public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
    LogHelper.info("CoolDown: " + coolDown);
    LogHelper.info("World.isRemote: " + world.isRemote);
    LogHelper.info("entityPlayer.worldObj.isRemote: " + entityPlayer.worldObj.isRemote);

    coolDown();

    if (entityPlayer.isSneaking()
        && entityPlayer.capabilities.isCreativeMode) // Change command in creative (MOVE THIS!)
    {
      NBTHelper.setInteger(itemStack, "commandID", NBTHelper.getInt(itemStack, "commandID") + 1);
      if (NBTHelper.getInt(itemStack, "commandID") > 4)
        NBTHelper.setInteger(itemStack, "commandID", 0);
    } else {
      if (!world.isRemote) {

        if (NBTHelper.getBoolean(itemStack, "isSet")) {
          LogHelper.info("Entered Function"); // DEBUG

          if (NBTHelper.getString(itemStack, "owner") == entityPlayer.getDisplayName()) {
            runCommand(itemStack, world, entityPlayer);
            ChatHelper.send(entityPlayer, "Command: " + NBTHelper.getString(itemStack, "command"));
            --itemStack.stackSize;
          } else {
            ChatHelper.send(entityPlayer, "You do not understand the symbols on the page.");
          }

        } else {
          NBTHelper.setBoolean(itemStack, "isSet", true);
          LogHelper.info("Entered Else"); // DEBUG
          ChatHelper.send(
              entityPlayer, EnumChatFormatting.BLUE + "The scroll reveals its true power!");
          NBTHelper.setBoolean(itemStack, "isSet", true);
          NBTHelper.setString(itemStack, "owner", entityPlayer.getDisplayName());
          NBTHelper.setString(itemStack, "command", getCommand(itemStack));
        }
      }
    }
    return itemStack;
  }
 @Override
 public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
   String ownerName = ((TileVendorBlock) world.getTileEntity(x, y, z)).blockOwner;
   if (player.capabilities.isCreativeMode) {
     super.removedByPlayer(world, player, x, y, z);
     return true;
   }
   if (player.getDisplayName().matches(ownerName) && !world.isRemote) {
     ItemStack stack = getItemStackWithData(world, x, y, z);
     EntityItem entityItem = new EntityItem(world, x, y, z, stack);
     world.spawnEntityInWorld(entityItem);
     super.removedByPlayer(world, player, x, y, z);
     return true;
   }
   return false;
 }
 @Override
 public void onSlotChanged() {
   super.onSlotChanged();
   if (inventory.getStackInSlot(0) != null) {
     // System.out.println(getStack()+",
     // "+PlayerManagerTFC.getInstance().getPlayerInfoFromName(thePlayer.getDisplayName()).specialCraftingType);
     if (valids.contains(getStack().getItem())
         && container != null
         && getStack().getItemDamage()
             == PlayerManagerTFC.getInstance()
                 .getPlayerInfoFromName(thePlayer.getDisplayName())
                 .specialCraftingType
                 .getItemDamage()) {
       container.onCraftMatrixChanged(craftMatrix);
     }
   }
 }
  @Override
  public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
    if (!world.isRemote) {

      if (NBTHelper.hasTag(itemStack, "owner") && NBTHelper.hasTag(itemStack, "timeout")) {
        /* If the timeout is 0, draw a new card. */
        if (NBTHelper.getLong(itemStack, "timeout") == 0) {
          drawCard(itemStack, world, player);
          itemStack.damageItem(1, player);
          NBTHelper.setLong(itemStack, "timeout", world.getTotalWorldTime());
        } else {
          ChatHelper.send(player, "Timeout time: " + NBTHelper.getLong(itemStack, "timeout"));
          ChatHelper.send(player, "World time: " + world.getTotalWorldTime());
        }
      } else {
        /* Initialize NBT values */
        NBTHelper.setLong(itemStack, "timeout", 0);
        NBTHelper.setString(itemStack, "owner", player.getDisplayName());
        makeDeck(itemStack);
      }
    }
    return super.onItemRightClick(itemStack, world, player);
  }
Exemple #18
0
 @Command(
     aliases = "r",
     desc = "Reply to the person, that sent you the last message.",
     usage = "/r <message>")
 public void replyToPm(@Sender EntityPlayer sender, @Text String message) {
   try {
     UserId target = (UserId) recipients.get(sender.getUniqueID());
     if (target.getEntityPlayer() != null) {
       target
           .getEntityPlayer()
           .addChatMessage(
               new ChatComponentText(
                   String.format(
                       "%s(%s - Message from %s%s: %s)",
                       EnumChatFormatting.GRAY,
                       formattedDate,
                       sender.getDisplayName(),
                       EnumChatFormatting.GRAY,
                       message.trim())));
     }
   } catch (NullPointerException e) {
     sender.addChatMessage(Messages.error(tr("whisper.r.nobody-to-reply-to")));
   }
 }
 private void giveItem(EntityPlayer entityPlayer) {
   EntityItem entityitem =
       entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(Items.diamond, 10), false);
   entityitem.delayBeforeCanPickup = 0;
   entityitem.func_145797_a(entityPlayer.getDisplayName());
 }
Exemple #20
0
 public void actionSwitchTab(int tab, EntityPlayer player) {
   NBTTagCompound nbt = new NBTTagCompound();
   nbt.setByte("tab", (byte) tab);
   nbt.setString("player", player.getDisplayName());
   this.broadcastPacketInRange(this.createDataPacket(nbt));
 }
Exemple #21
0
 public static String getUsername(EntityPlayer player) {
   return player.getDisplayName();
 }
  public void processCommand(ICommandSender S, String[] argString) {
    World W = S.getEntityWorld();
    CommandUtils C = new CommandUtils();
    EntityPlayer P = C.getPlayer(S);
    // System.out.println(P.getCommandSenderName());
    // System.out.println(P.getDisplayName());

    if (MinecraftServer.getServer().getConfigurationManager().func_152596_g(P.getGameProfile())) {
      try {
        if (argString[0].equals(null) && argString.length <= 0) {
          Utils.sendChatToPlayer(P, "Please enter a number after the command");
          Radius = 250;
          Utils.LOG_INFO("Setting value to 250 as default.");
        } else if (!argString[0].equals(null) || argString.length > 0) {
          String commandValue = argString[0];
          if (!commandValue.equals(null)) {

            try {
              Radius = Integer.parseInt(commandValue);
              Utils.LOG_INFO("Setting search radius value to " + Radius);
            } catch (NumberFormatException e) {
              Utils.sendChatToPlayer(P, "Please enter a number after the command");
              Radius = 250;
              Utils.LOG_INFO("Setting value to 250 as default.");
            }
            // Utils.LOG_INFO("Command Value: "+commandValue);
          } else if (commandValue.equals(null)) {
            Utils.LOG_INFO("No Value Given.");
          }
        } else {
          //
        }

        // Decode Entity Name
        try {
          if (argString[1].equals(null) && argString.length <= 1) {
            // ERROR
          } else if (!argString[1].equals(null) || argString.length > 1) {
            String commandValue1 = argString[1];
            if (!commandValue1.equals(null)) {

              try {
                mob = commandValue1;
                Utils.LOG_INFO("Setting Entity value to " + mob);
              } catch (NumberFormatException e) {
                Utils.sendChatToPlayer(P, "Please enter a name after the command");
                // Radius = 250;
                // Utils.LOG_INFO("Setting value to 250 as default.");
              }
              // Utils.LOG_INFO("Command Value: "+commandValue);
            } else if (commandValue1.equals(null)) {
              Utils.LOG_INFO("No Value Given.");
            }
          }

        } catch (ArrayIndexOutOfBoundsException e) {
          Utils.sendChatToPlayer(
              P, "Please enter a number after the command, do not leave it blank");
          Utils.LOG_INFO("Please enter a number after the command, do not leave it blank");
        }

        // minimum space between mobs
        try {
          if (argString[2].equals(null) && argString.length <= 2) {
            return;
          } else if (!argString[2].equals(null) || argString.length > 2) {
            String commandValue1 = argString[2];
            if (!commandValue1.equals(null)) {

              try {
                minDis = Integer.parseInt(commandValue1);
                Utils.LOG_INFO("Setting Minimum distance value to " + minDis);
              } catch (NumberFormatException e) {
                Utils.sendChatToPlayer(P, "Please enter a minimum entity space after the name");
                // Radius = 250;
                // Utils.LOG_INFO("Setting value to 250 as default.");
              }
              // Utils.LOG_INFO("Command Value: "+commandValue);
            } else if (commandValue1.equals(null)) {
              Utils.LOG_INFO("No Value Given.");
            }
          }

        } catch (ArrayIndexOutOfBoundsException e) {
          Utils.sendChatToPlayer(P, "Please enter a minimum entity space after the name");
          Utils.LOG_INFO("Please enter a minimum entity space after the name");
        }

        if (W.isRemote) {
          Utils.LOG_INFO("Not processing on Client side");
        } else {
          Utils.LOG_INFO(
              "Processing on Server side - Villager/RfTools Sequencer Wipe engaged by: "
                  + P.getDisplayName());
          ChunkCoordinates X = P.getPlayerCoordinates();
          Utils.LOG_WARNING("Player Location: " + X);
          // Insert Code
          FindEntity.get(S, W, mob, Radius, minDis);
        }
      } catch (ArrayIndexOutOfBoundsException e) {
        Utils.sendChatToPlayer(P, "Please enter a number after the command, do not leave it blank");
        Utils.LOG_INFO("Please enter a number after the command, do not leave it blank");
      }
    } else {
      Utils.sendChatToPlayer(P, "You are not allowed to use this command.");
    }
  }
  public static void storeExtendedPropertiesForRespawn(EntityPlayer player) {
    // extended properties
    // ================================================================================
    if (storedExtProps_death.containsKey(player.getDisplayName()))
      storedExtProps_death.remove(player.getDisplayName());

    NBTTagCompound save = new NBTTagCompound();
    ExtendedProperties.For(player).saveNBTData(save);

    storedExtProps_death.put(player.getDisplayName(), save);

    // ================================================================================
    // rift storage
    // ================================================================================
    if (riftStorage_death.containsKey(player.getDisplayName()))
      riftStorage_death.remove(player.getDisplayName());
    NBTTagCompound saveRift = new NBTTagCompound();
    RiftStorage.For(player).saveNBTData(saveRift);

    riftStorage_death.put(player.getDisplayName(), saveRift);

    // ================================================================================
    // affinity storage
    // ================================================================================
    if (affinityStorage_death.containsKey(player.getDisplayName()))
      affinityStorage_death.remove(player.getDisplayName());
    NBTTagCompound saveAffinity = new NBTTagCompound();
    AffinityData.For(player).saveNBTData(saveAffinity);

    affinityStorage_death.put(player.getDisplayName(), saveAffinity);
    // ================================================================================
    // affinity storage
    // ================================================================================
    if (spellKnowledgeStorage_death.containsKey(player.getDisplayName()))
      spellKnowledgeStorage_death.remove(player.getDisplayName());
    NBTTagCompound saveSpellKnowledge = new NBTTagCompound();
    SkillData.For(player).saveNBTData(saveSpellKnowledge);

    spellKnowledgeStorage_death.put(player.getDisplayName(), saveSpellKnowledge);
    // ================================================================================
  }
  public static void storeExtendedPropertiesForDimensionChange(EntityPlayer player) {
    // extended properties
    // ================================================================================
    if (!storedExtProps_death.containsKey(player.getDisplayName())) {
      if (storedExtProps_dimension.containsKey(player.getDisplayName()))
        storedExtProps_dimension.remove(player.getDisplayName());

      NBTTagCompound saveExprop = new NBTTagCompound();
      ExtendedProperties.For(player).saveNBTData(saveExprop);

      storedExtProps_dimension.put(player.getDisplayName(), saveExprop);
    }
    // ================================================================================
    // rift storage
    // ================================================================================
    if (!riftStorage_death.containsKey(player.getDisplayName())) {
      if (riftStorage_dimension.containsKey(player.getDisplayName()))
        riftStorage_dimension.remove(player.getDisplayName());

      NBTTagCompound saveRift = new NBTTagCompound();
      RiftStorage.For(player).saveNBTData(saveRift);

      riftStorage_dimension.put(player.getDisplayName(), saveRift);
    }
    // ================================================================================
    // affinity storage
    // ================================================================================
    if (!affinityStorage_death.containsKey(player.getDisplayName())) {
      if (affinityStorage_dimension.containsKey(player.getDisplayName()))
        affinityStorage_dimension.remove(player.getDisplayName());

      NBTTagCompound saveAffinity = new NBTTagCompound();
      AffinityData.For(player).saveNBTData(saveAffinity);

      affinityStorage_dimension.put(player.getDisplayName(), saveAffinity);
    }
    // ================================================================================
    // spell knowledge storage
    // ================================================================================
    if (!spellKnowledgeStorage_death.containsKey(player.getDisplayName())) {
      if (spellKnowledgeStorage_dimension.containsKey(player.getDisplayName()))
        spellKnowledgeStorage_dimension.remove(player.getDisplayName());

      NBTTagCompound spellKnowledge = new NBTTagCompound();
      SkillData.For(player).saveNBTData(spellKnowledge);

      spellKnowledgeStorage_dimension.put(player.getDisplayName(), spellKnowledge);
    }
    // ================================================================================
  }
Exemple #25
0
 public int getPlayerThirst(EntityPlayer player) {
   return thirstMap.get(player.getDisplayName());
 }