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;