Package appeng.api.me.items

Examples of appeng.api.me.items.IMemoryCard


    if (!world.isRemote)
    {
      ItemStack currentItem = player.inventory.getCurrentItem();
      if (currentItem != null)
      {
        IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler();
        TileEntity blockTE = world.getBlockTileEntity(x, y, z);

        if (card.isMemoryCard(currentItem))
        {
          if (player.isSneaking())
          {
            NBTTagCompound nbt = new NBTTagCompound();
            blockTE.writeToNBT(nbt);
            nbt.removeTag("x");
            nbt.removeTag("y");
            nbt.removeTag("z");
            blockTE.readFromNBT(nbt);
            card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved")));
            return true;
          } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank"))
          {
            blockTE.readFromNBT(card.getData(currentItem));
            Packet description = blockTE.getDescriptionPacket();
            if (description != null)
              PacketDispatcher.sendPacketToAllPlayers(description);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded")));
            return true;
View Full Code Here


    if (!world.isRemote)
    {
      ItemStack currentItem = player.inventory.getCurrentItem();
      if (currentItem != null)
      {
        IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler();
        TileEntity blockTE = world.getBlockTileEntity(x, y, z);

        if (card.isMemoryCard(currentItem))
        {
          if (player.isSneaking())
          {
            NBTTagCompound nbt = new NBTTagCompound();
            blockTE.writeToNBT(nbt);
            nbt.removeTag("x");
            nbt.removeTag("y");
            nbt.removeTag("z");
            blockTE.readFromNBT(nbt);
            card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved")));
            return true;
          } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank"))
          {
            blockTE.readFromNBT(card.getData(currentItem));
            Packet description = blockTE.getDescriptionPacket();
            if (description != null)
              PacketDispatcher.sendPacketToAllPlayers(description);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded")));
            return true;
View Full Code Here

    if (!world.isRemote)
    {
      ItemStack currentItem = player.inventory.getCurrentItem();
      if (currentItem != null)
      {
        IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler();
        TileEntity blockTE = world.getBlockTileEntity(x, y, z);

        if (card.isMemoryCard(currentItem))
        {
          if (player.isSneaking())
          {
            NBTTagCompound nbt = new NBTTagCompound();
            blockTE.writeToNBT(nbt);
            nbt.removeTag("x");
            nbt.removeTag("y");
            nbt.removeTag("z");
            blockTE.readFromNBT(nbt);
            card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved")));
            return true;
          } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank"))
          {
            blockTE.readFromNBT(card.getData(currentItem));
            Packet description = blockTE.getDescriptionPacket();
            if (description != null)
              PacketDispatcher.sendPacketToAllPlayers(description);
            player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded")));
            return true;
View Full Code Here

TOP

Related Classes of appeng.api.me.items.IMemoryCard

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.