69702 {
69703 if (Main.netMode == 1 || !Main.hardMode)
69704 {
69705 return false;
69706 }
69707 int num = Chest.FindChest(x, y);
69708 if (num < 0)
69709 {
69710 return false;
69711 }
69715 for (
int i = 0;
i < 40;
i++)
69716 {
69717 ushort
num5 = Main.tile[Main.chest[num].x, Main.chest[num].y].type;
69718 int num6 = Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36;
69720 {
69721 if (Main.chest[num].item[i].type == 3092)
69722 {
69723 num2 += Main.chest[num].item[
i].stack;
69724 }
69725 else if (Main.chest[num].item[i].type == 3091)
69726 {
69727 num3 += Main.chest[num].item[
i].stack;
69728 }
69729 else
69730 {
69732 }
69733 }
69734 }
69736 {
69738 {
69740 }
69742 {
69743 if (Main.tile[x, y].frameX % 36 != 0)
69744 {
69745 x--;
69746 }
69747 if (Main.tile[x, y].frameY % 36 != 0)
69748 {
69749 y--;
69750 }
69751 int number = Chest.FindChest(x, y);
69752 for (
int j = 0;
j < 40;
j++)
69753 {
69754 Main.chest[num].item[
j] =
new Item();
69755 }
69756 Chest.DestroyChest(x, y);
69757 for (
int k = x;
k <= x + 1;
k++)
69758 {
69759 for (
int l = y;
l <= y + 1;
l++)
69760 {
69762 {
69763 Main.tile[
k,
l].ClearTile();
69764 }
69765 }
69766 }
69768 if (Main.tile[x, y].type == 467)
69769 {
69771 }
69772 NetMessage.SendData(34, -1, -1,
null,
number2, x, y, 0f,
number);
69773 NetMessage.SendTileSquare(-1, x, y, 3);
69774 }
69777 {
69779 }
69780 int num8 =
NewNPC(
user.GetNPCSource_TileInteraction(x, y), x * 16 + 16, y * 16 + 32,
num7);
69782 NetMessage.SendData(23, -1, -1,
null,
num8);
69783 Main.npc[
num8].BigMimicSpawnSmoke();
69784 }
69785 return false;
69786 }
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)