Ejemplo n.º 1
0
 public override bool RecipeAvailable(Recipe recipe)
 {
     if (!active)
     {
         return(true);
     }
     try {
         Player        player    = Main.player[Main.myPlayer];
         StoragePlayer modPlayer = player.GetModPlayer <StoragePlayer>();
         (Point16 storageAccess, Type t) = modPlayer.ViewingStorage();
         return(storageAccess.X < 0 || storageAccess.Y < 0);
     }
     catch {
         return(true);
     }
 }
Ejemplo n.º 2
0
        public static void ReceiveOperationResult(BinaryReader reader)
        {
            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                return;
            }
            Player player = Main.player[Main.myPlayer];
            byte   op     = reader.ReadByte();

            if (op == 0 || op == 1 || op == 3)
            {
                Item item = ItemIO.Receive(reader, true);
                StoragePlayer.GetItem(item, op != 3);
            }
            else if (op == 2)
            {
                int count = reader.ReadByte();
                for (int k = 0; k < count; k++)
                {
                    Item item = ItemIO.Receive(reader, true);
                    StoragePlayer.GetItem(item, false);
                }
            }
        }